Skip to content

Color schemes

A color scheme sets the color of each element’s atom labels and of the bonds attached to them. For example, to draw ethanol with a red O, click Scheme: in the status bar and select Simple. The scheme is independent of the structure preset, which sets geometry and fonts, so you can change one without changing the other.

New documents start with the scheme you last applied, or Black & White if you have never applied one.

Cysteine drawn in each built-in color scheme: Simple, Black and White, CPK, Colorblind, WCAG, and Publication, each named under its drawing.
Cysteine (N, O, and S) in each built-in color scheme.

Molkit has six built-in schemes:

  • Simple: red oxygen, blue nitrogen, green halogens, and similar conventional colors. Element coloring on.
  • Black & White: every element drawn black. Element coloring off, so the canvas stays monochrome.
  • CPK (Jmol): the Jmol CPK palette (gray carbon, red oxygen, blue nitrogen), with hydrogen gray and sulfur a darker yellow so that both show on a white page. 3D views keep Jmol’s white hydrogen.
  • Colorblind Safe: a palette chosen to stay distinguishable for common color-vision deficiencies.
  • WCAG AA: darker, higher-contrast versions of the standard colors, aimed at passing contrast checks.
  • Publication: the same all-black colors as Black & White.

With element coloring on, each half of a bond takes the color of the atom at that end. When that end is a condensed label such as OCH3, NH2, or SO3H, the bond takes the color of the element that the bond attaches to, for example the O of OCH3.

Schemes with element coloring off draw everything in one color, whatever per-element values the scheme stores. To make those values visible, turn element coloring on (see Element coloring).

The Scheme: item in the status bar shows the active scheme. Click it to open its menu, which lists the built-in schemes, then your custom schemes, then three commands: Edit Scheme…, Save Current as Scheme…, and Apply to All Tabs (which asks you to confirm first, and marks each tab it changes as unsaved; Undo in that tab reverses the change as one step). Selecting a scheme applies it to the current document.

A dot next to the scheme name means that you have changed colors from that scheme’s defaults. To discard those changes, open the menu and select the active scheme again.

To open the editor, click Edit Scheme… in the Scheme: menu, or press Ctrl+K and run Element Colors… from the command palette. The editor changes the per-element colors of the active scheme and can save the result as a new named scheme.

The editor opens in Visual view.

Visual view is a periodic table grid in which each cell is one element:

  • To edit an element’s color, click its cell.
  • To select several, Ctrl+click cells, Shift+click to select a range by atomic number, or click a category in the legend. Then right-click a selected cell and choose Paste Color or Reset to change them all at once.
  • A plain click selects only that cell again.

Code view shows a table of every element:

  • Separate Light and Dark color fields for each element.
  • A filter box. The filter matches a symbol, a name, or a category, such as hal for halogens.
  • Sort options: Atomic #, Alphabetical, By Color (Hue), Modified First, Warnings First.
  • Copy all, which copies the rows shown to the clipboard as tab-separated text: symbol, light color, dark color, and auto or manual.

The Light / Dark toggle in the header chooses which table you edit, so a custom scheme can carry dark colors for theme-aware exports as well as its light ones. The built-in schemes have a single table.

In Code view, a row’s Auto box makes its dark color follow the light one. The Auto box in the table header is checked when every row shown is auto, shows a mixed state when only some are, and sets every row shown at once.

The color scheme editor for the Simple scheme in Visual view: a periodic table grid with each element in its color, warning triangles on the cells whose color has low contrast against white, a count of 16 warnings in the header, the category buttons above the grid, and Save as Scheme, Revert, Reset to Scheme, Export, Import, and Done along the bottom.
The editor in Visual view, checking contrast against white.

The Check against: list in the toolbar selects a background: White, Light gray, Dark, Canvas bg, or Custom…. The editor computes a WCAG contrast ratio for each element against that background and flags the elements that fall short. The header shows how many elements fall short; to see them together in Code view, sort by Warnings First.

To turn element coloring on, select Structure > Display > Bond Colors by Element, or select Color by Element on the Bonds tab of Structure Settings; both are the same switch. If element coloring is off, a banner in the editor reminds you that edited colors do not show until you turn it on. The Grayscale checkbox in the toolbar previews how the scheme reads without color.

Button What it does
Save as Scheme… Stores the current colors under a name you choose. Saved schemes appear in the Scheme: menu under a Custom heading and stay in this browser.
Revert Returns to the colors you had when you opened the editor.
Reset to Scheme Restores the active scheme’s default colors.
Export > Export CSS or Export JSON Downloads the colors as a CSS file, with a rule for every element class (.mk-C, .mk-O) in the colors the editor shows, defaults included, and the dark colors in a dark-mode block, or as a JSON file.
Import > Import CSS or Import JSON Reads colors from such a file.
Done Closes the editor and keeps your changes.

To move a scheme and a preset together, use a style bundle from the Preset: menu instead; see The preset menu.