1 The Design Window
liquibyte edited this page 2026-11-19 16:23:31 -06:00

The Design Window

The Design window shows a web page, your own HTML and CSS, in a real browser engine (WPE WebKit), and recolors it with your colors. The page's files are never changed: Gamut lays its colors over them, and Export CSS writes the result into a stylesheet of its own. This page describes the window, loading a page, the Color Map, bringing your harmony in, coloring single elements, the toolbar, and exporting.

1. Opening the window

Tick Design in the main window; untick it to hide the window again. The window's close button also only hides it, and unticks Design. The window's title is "Design"; it opens at 1280 by 900 pixels the first time and remembers its size and place after that. It belongs with the main window: it is minimized and raised with it, and it is hidden while you pick with "Hide on pick" on, or while the measurement overlay is open with "Hide gamut windows while active" on.

The browser engine starts a moment after the main window appears. Until you load a page, the window shows Gamut's built-in help; if a page was open when Gamut last closed, that page is loaded again instead.

2. The parts of the window

The Design window: the menu bar and the toolbar at the top, the page view on the left with the optional inspector below it, the gradient strip and the Color Map on the right, and the status bar at the bottom

The Design window. The inspector appears only with the Inspector checkbox ticked; the page view then becomes shorter.

3. The menus

Menu Item What it does
File Load HTML Open a page (dialog "Open HTML File", filter "HTML files": .html and .htm). The stylesheets it links are read too; see section 4.
Load CSS Add another stylesheet to the page (dialog "Open CSS File", filter "CSS files").
Export CSS Write the recolored stylesheet to a file you choose (dialog "Save CSS File"); see section 10.
Edit Undo Take back the last color you set on a single element or the last gradient you dropped, up to eight steps.
Redo Do it again.
Refresh Reload the page in the browser engine, keeping the colors you set.
Help View Help Show Gamut's built-in help pages in the page view.

The menus also work from the keyboard: Alt+F, Alt+E or Alt+H opens File, Edit or Help, the arrow keys move through the items and to the next menu, Enter chooses, and Escape closes the menu.

Load HTML and Load CSS share one dialog; Export CSS has its own. Each remembers the folder it was last in. The first time a dialog opens, it starts in your home folder, or in the folder of the last file chosen in either dialog. The folders are kept between runs. Saving over an existing file asks first.

4. Loading a page

File > Load HTML opens a page from your disk. Gamut reads the colors of the page's <style> blocks and of each local stylesheet that a <link rel="stylesheet" href="..."> names (the href must be in quotes; stylesheets on the web are skipped). File > Load CSS adds further stylesheets, up to 16; the same file is not loaded twice. A file larger than 1 MB is not read. Loading a new page clears the added stylesheets, the colors you set on single elements and the undo history. The status bar shows the page's path.

The page is live: scripts run, links work, the mouse wheel scrolls (a scrollbar appears at the right when the page is taller than the view), and a right-click gives Copy, Cut, Paste and Select All, unless the page has a menu of its own. A link to another local page is followed, and that page's stylesheets are read in the same way, whatever characters its path holds. A link to an #anchor scrolls to it, and keeps the page's stylesheets.

Gamut understands colors written as #rgb, #rrggbb and #rrggbbaa, as rgb() and rgba() with numbers separated by commas, and as hsl() and hsla() with commas. Other ways of writing a color are left as they are.

5. The Color Map

The panel at the right is headed "Color Map (n)", where n is the number of rows. Each row shows a color of the page under Original, an arrow, and a color of your palette under Palette, with their hex values under them. The rows follow the order in which the colors first appear in the stylesheets. The mouse wheel scrolls the list.

  • The palette is what recolors the page: each color of the page is replaced by the nearest color of the palette (by its Lab distance). The Palette column shows your harmony's colors from the start, so a page you load with Load HTML is recolored with the harmony at once. After Sort (section 6) the palette is the page's own colors, and the page looks as it was written.
  • The palette holds your harmony's colors, at most twelve. When the page has more colors than the palette, the rows after it show lighter and darker versions of the palette colors. These extra rows are only for show: the page does not use them.
  • A palette color brought in with Fill All or Assign has a role name under it instead of its hex value: Primary, Complement, Second, Third, Split 1, Split 2, Warm, Cool, Accent and so on, depending on the scheme.
  • Click under a palette swatch to type a new hex value for it (only hex digits and #; a three-digit value such as #abc means #aabbcc; Enter or a click elsewhere applies it, Escape cancels). The page takes the new color at once. The usual editing keys and a right-click menu work in this box.
  • Right-click a palette swatch to lock that color, or to unlock it. A locked color has an amber bar under its swatch, and keeps its color, its role name and its place when the palette changes: a harmony change, a Fill All or Assign drop, or Sort.
  • Drag a palette or original swatch onto the page to color one element (section 7).
  • Drag a swatch onto the main window to make its color, with its alpha, the current color there.

Above the list, the gradient strip shows the Gradient tab's gradient (dark grey when there is none). Drag it onto an element to give that element the gradient as its background.

6. Bringing your harmony in

Drag a swatch from the main window's Harmony tab, or from the Theming tab, and drop it on the Color Map. What happens depends on the mode chosen in the toolbar; Fill All is the first one, and your choice is kept between runs.

Mode A drop on the Color Map
Fill All Fills the palette with the whole harmony, each color named by its role, except the locked colors. The dropped color itself does not matter. The page is recolored.
Set Base Makes the dropped color the current color in the main window (the current alpha stays as it was), so the harmony is built again from it.
Assign Puts the dropped color first in the palette, with its role (or, from the Theming tab, its custom-property name or hex value), and the rest of the harmony after it, except the locked colors. The page is recolored.
Sort Puts the page's own colors back into the palette, ordered by how close their hue is to the dropped color; a locked color keeps its color and place. The page then looks as it was written (apart from the locked colors).

A harmony change in the main window (a new pick, dragging on the wheel, another scheme) updates the Palette column of the Color Map at once. With Live Mode on (section 8) the page follows a moment later, once the colors stop changing, so a drag on the wheel stays smooth. With Live Mode off the page is recolored only by a Fill All, Assign or Sort drop, a typed hex value, or loading a page or stylesheet.

7. Coloring one element

Drag a swatch from the Color Map onto the page. The element under the pointer gets an orange outline, and the status bar names it (for example div#main or p.note). When you let go, a menu asks what to color:

Group Items Applies to
The element Background color; Text color; Text decoration color (also underlines); Border color (all sides), Border top, right, bottom or left color (a solid border appears even where there was none); Outline color (a 2-pixel solid outline); Caret color; Accent color The dropped element only
Selection Selection highlight color; Selection text color The whole page, wherever you dropped
Placeholder Placeholder text color
Links Link color; Link background; Visited link color
Inputs Input / textarea background, text color, border color
Buttons Button background, text color, border color
Hover Hover: background, text color, border color The dropped element while the pointer is over it

The element keeps that color: it does not follow later palette changes. Setting the same property on the same element again replaces the earlier color. Up to 256 such colors can be set. Edit > Undo and Redo step through them, and through dropped gradients. Dragging the gradient strip onto an element sets its background to the gradient at once, without the menu.

8. The toolbar

Control What it does
Vision Shows the page as someone with a color vision deficiency sees it: Normal, Protanopia, Deuteranopia, Tritanopia, Protanomaly, Deuteranomaly, Tritanomaly or Achromatopsia. The Color Map's swatches are shown the same way. It starts on Normal at every run.
Fill All, Set Base, Assign, Sort The drop mode (section 6).
Live Mode On: every harmony change in the main window recolors the page (section 6). Off: the page stays as it is while you try things; the Color Map's Palette column still follows the harmony. Turning it on recolors the page at once. On at first.
Drop Zones Outlines every element of the page with a dashed line, so that you can see what you can drop on.
Pin Menu Adds the class menus-pinned to the page's <body>, so that a page written for it keeps its drop-down menus open while you color them.
Inspector Opens the inspector under the page (section 9).

Drop Zones, Pin Menu, Live Mode and Inspector are kept between runs, and still apply after you follow a link.

9. The inspector

With Inspector ticked, a 280-pixel panel opens under the page. Hovering an element outlines it in blue; clicking it selects it (orange outline) and shows:

  • its tag, id and classes, and its path: up to eight levels, ending with the element itself, with "…" in front when there are more;
  • a contrast bar: its text and background colors, their contrast ratio and its grade (AAA, AA, AA Large or Fail);
  • its colors, and its computed CSS: color, background, border and outline colors, font, line height, display, position, size, padding, margin, border, radius, shadows, opacity, text alignment, cursor and flex direction. Empty and default values are left out. The filter box narrows the list by property name.

The values are the element's own: the blue and orange outlines are left out. Click a value to copy it; "copied" flashes for a moment. The inspector's height is fixed.

10. Exporting

File > Export CSS writes one stylesheet with:

  1. a :root block of custom properties for the palette colors that have a role name (--primary, --complement, --split-1 ...), when there are any;
  2. all of the page's CSS (its <style> blocks and every stylesheet) with each color replaced by its palette color (as rgba() when the color is transparent);
  3. one rule for each color you set on a single element or gradient you dropped, as the page shows it: a gradient as the element's background, a transparent color as rgba(), and with the solid border, outline or underline that Gamut adds for a border, outline or text decoration color.

Use it in place of the page's own stylesheets. Nothing is written when there is no CSS and no role name.

11. What is remembered

When Gamut closes it keeps, in state.dat in Gamut's folder (where): whether the window was open, its size and place, the page and the added stylesheets, the folders of the dialogs, the drop mode, and the four checkboxes. The Vision choice, the colors set on single elements, typed hex values and the undo history are not kept.

12. Known limitations

  • Dragging a harmony swatch straight onto the page does nothing; drop it on the Color Map, then drag from there.
  • A role name disappears when the harmony changes (unless the color is locked) or when you type a hex value for that color, and its custom property is then not exported.
  • Locks are not kept when Gamut closes.
  • Dragging a swatch within the Color Map only swaps the rows on the screen.
  • The inspector cannot be resized.
  • Refresh does not read the stylesheets from disk again; use Load HTML after changing them.
  • Colors in style="" attributes, SVG attributes, named colors and newer CSS color syntax are not seen.
  • There is no Back after following a link or viewing the help.