Skip to content

Color Schemes

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

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

Built-in schemes

Molkit ships six 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, white hydrogen, red oxygen, blue nitrogen).
  • 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: all-black like Black & White, intended for print figures.

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 the bond attaches to, for example the O of OCH3.

Schemes marked “element coloring off” draw everything in one color regardless of the per-element values stored in the scheme. Turn element coloring on (see the editor below) to make those values visible.

Switching schemes

The status item Scheme: shows the active scheme; click it to open the dropup. It lists the built-in schemes, then your custom schemes, then three actions: Edit Scheme…, Save Current as Scheme… and Apply to All Tabs (which asks for confirmation first). Picking a scheme applies it to the current document right away.

An orange dot next to the scheme name means you have edited colors away from that scheme’s defaults. To discard those edits, open the dropup and pick the active scheme again.

The Color Scheme Editor

Choose Edit Scheme… from the dropup to open the editor, 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.

Editing colors

The editor opens in Visual view: a periodic-table grid where each cell is one element. Click a cell to edit its color; shift-click or drag to select a range and edit several at once. The Code view switches to a table of every element with separate Light and Dark color fields, a filter box (match by symbol, name, or category such as hal for halogens), and sort options (atomic number, alphabetical, by hue, modified first, warnings first).

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

Contrast checking

The toolbar’s Check against: selector picks a background (white, light gray, dark, canvas background or a custom color). The editor computes a WCAG contrast ratio for each element against it and flags the elements that fall short.

Element coloring toggle

If element coloring is off, a banner reminds you that edited colors will not show until you enable it. The Grayscale checkbox in the toolbar previews how the scheme reads without color.

Saving, import, and export

ButtonWhat it does
Save as Scheme...Stores the current colors under a name you choose. Saved schemes appear in the dropup under a Custom heading and stay in this browser.
RevertReturns to the colors present when you opened the editor.
Reset to SchemeRestores the active scheme’s default colors.
Export ▾ > Export CSS or Export JSONDownloads the colors as a CSS file of custom properties or as a JSON file.
Import ▾ > Import CSS or Import JSONReads colors from such a file.
DoneCloses the editor and keeps your changes.

To move a scheme and a preset together, use a style bundle from the preset dropup instead; see Structure Presets.

See also