This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Measuring the Screen
The measurement overlay lies over the whole screen and measures anything on it, not only Gamut: sizes and distances, angles, the contrast between two colors, the space around the pointer. It can sample colors into a palette, show grids, rulers, a loupe and responsive breakpoints, and save what you measured as SVG, CSS and JSON. This page describes the settings dialog, every key, and the files the overlay writes.
1. Opening and closing the overlay
Tick Measure in the main window. The Measurement Settings dialog opens; ticking the checkbox does not start the overlay yet. Choose the settings and press OK (or Enter): the overlay opens and covers every monitor.
The dialog stays open beside the overlay, so that you can change a setting and press OK again; the new settings apply to the running overlay at once.
The overlay closes with Escape or Q, with Cancel (or Escape) in the dialog, with the dialog's close button, by unticking Measure (which also hides the dialog), or when Gamut quits. Cancel and the close button also set the dialog's controls back to the settings in use, so changes you did not confirm with OK are dropped. Closing it saves its session: the measurements and the sampled palette come back the next time it opens.
The dialog has a fixed size and no minimize button, is kept off the taskbar, remembers its place, and follows Gamut's theme. If it was open when Gamut closed, it opens again at the next start; the overlay itself never starts on its own.
While the overlay is open it takes the keyboard (every key goes to it) and the middle mouse button on the whole screen. Left and right clicks still reach the windows underneath, so you can go on using them.
2. The Measurement Settings dialog
The dialog has four parts: GRID, CROSSHAIR, OPTIONS and KEYS. Its choices are kept in measure/config.json in Gamut's folder when you press OK (see section 6).
| Setting | Values (first value) | What it does |
|---|---|---|
| Off, Pixel, Column, Baseline, Iso | one of five (Pixel) | The grid: none; a square grid of lines; 12 filled columns with 16-pixel gutters across the screen; horizontal lines only; or an isometric grid of diagonal lines with a slope of one half both ways. |
| Clear Pal. | button | Empties the palette of sampled colors at once, without OK. While the overlay is closed it empties the palette of the saved session, so the next overlay starts without one. |
| Grid Spacing | 4 to 128 px (32) | The distance between grid lines (not used by Column). Dimmed when the grid is Off. |
| Grid Opacity | 0 to 100 % (25) | How strongly the grey grid shows. Dimmed when the grid is Off. |
| Show crosshair | on or off (on) | A white cross through the pointer across the whole screen, with its position. |
| Crosshair Opacity | 10 to 100 % (80) | How strongly the crosshair shows. |
| Pixel rulers (R) | on or off (off) | Rulers along the top and left edges of the screen. |
| Color loupe (Z) | on or off (off) | A magnified view of the pixels around the pointer. |
| Loupe Zoom | 2 to 32 x (4) | The loupe's magnification. Active only with the loupe on. |
| Snap to grid | on or off (off) | Line ends land on grid points, and the arrow keys move by one grid step. Needs a grid. |
| Snap to edges | on or off (on) | Line ends land on the nearest edge or center line of a window, within 12 pixels. |
| Breakpoints (B) | on or off (off) | Lines at the usual responsive widths: 360, 768, 1024, 1280, 1440 and 1920 pixels from the screen's left edge. |
| 8pt grid audit | on or off (off) | A stored measurement whose width or height is not a multiple of 8 is drawn in orange. |
| Snap windows to grid | on or off (off) | While the overlay is open, a window you move or resize snaps to the grid, and with Breakpoints on its width snaps to the nearest breakpoint, when it comes within the threshold. |
| Snap Threshold | 5 to 40 px, in steps of 5 (20) | How close a window must come before it snaps. Active only with "Snap windows to grid" on. |
| Hide gamut windows while active | on or off (off) | Hides the main window, the Design window and this dialog while the overlay is open, so that they are not in the way or in the picture. They come back when it closes. |
The KEYS part lists the middle mouse button and the overlay's keys in short form; they are all explained in section 4.
3. Measuring
Measuring is done with the keyboard or the middle mouse button, so that the left button stays free for the windows underneath:
- Put the pointer where the measurement starts and press
S(or press the middle button). - Move to where it ends and press
Sagain (or let go of the middle button).
While you move, a line follows the pointer with the label W: and H:, the width and height of the box between the two points. The finished measurement stays on the screen in green, and the newest six are listed at the top right of the screen as #N: W×H px. The overlay keeps up to 128 measurements; Backspace removes the last one and C clears them all.
Line ends snap: to grid points with "Snap to grid", and to window edges and centers with "Snap to edges" (whichever is closer wins). A mark shows where the pointer snaps: a thick orange cross on a grid point, or a thin magenta corner, edge or center shape on a window, and the position readout adds [snap]. The arrow keys move the pointer one pixel at a time (one grid step with "Snap to grid"), ten times as far with Shift; when no measurement is in progress they also move the last stored measurement.
The window under the pointer always gets a thin yellow border, with its size and its distances to the four edges of the screen.
4. Every key
| Key | What it does |
|---|---|
S, middle button |
Start or end a measurement at the pointer. In angle mode and in the contrast check, it places the next point or picks the next color. |
A |
Angle mode, on or off. Press S at the corner, then at the end of the first arm, then at the end of the second; the angle (0 to 180°) shows beside the corner. Angles are not stored or exported. |
V |
Caliper: the next measurement is horizontal only, then vertical only, then free again. A badge at the bottom left shows the mode. |
5 |
Sizes in pixels, in pixels and percent, or in percent of the screen's width and height. |
W |
Contrast check, on or off. Press S on the first color and on the second; the WCAG contrast ratio shows with its grade: AAA (7:1 or more), AA (4.5:1), AA Large (3:1) or FAIL. Press W twice to check another pair. |
I |
Spacing inspector, on or off: cyan lines from the pointer to the nearest window edge (or screen edge) in each of the four directions, with their lengths. |
P |
Add the color under the pointer to the palette, shown at the bottom right (up to 32 colors; a color already there is skipped). |
Shift+P |
Empty the palette. |
X |
Copy the palette as hex values, one per line. |
Ctrl+C |
Copy the last measurement as W x H px @ (X, Y), and with the loupe on also the hex value of the color under the pointer. |
D |
Difference mode, on or off: takes a picture of the screen, and from then on every pixel that differs from it is tinted red, so you can see what a change to a page or window moved. It needs the compositor (section 7). |
B |
Breakpoints, on or off. |
H |
Crosshair, on or off. With it off, the position readout goes too. |
R |
Rulers, on or off. |
Z |
Loupe, on or off: a 160-pixel square beside the pointer. With the loupe on, the crosshair's readout also shows the hex value under the pointer. |
+ (or =), - |
Loupe zoom one step in or out, from 2 to 32; turns the loupe on if it is off. |
| Arrow keys | Move the pointer one pixel (or one grid step); with Shift, ten. |
C |
Clear all measurements (and leave angle mode). |
Backspace |
Remove the last measurement. |
G |
Save the measurements as ~/measure-export.svg. |
E |
Save the measurements and the palette as ~/measure-export.css and ~/measure-export.json. |
/ |
Show the list of keys on the monitor under the pointer. Any key or a middle click closes it. |
Escape, Q |
Close the overlay. |
The R, Z, H and B keys and the loupe zoom change only the overlay that is open: the next OK in the dialog sets them back to the dialog's choices, and they are not kept for the next time.
5. Exports
Each export overwrites the file of the same name in your home folder, and a short message on the screen says what happened. With no measurements, G writes nothing and says "no measurements"; with no measurements and no palette, E writes nothing and says "nothing to export".
| File | Key | What is in it |
|---|---|---|
~/measure-export.svg |
G | An SVG the size of the screen with one green line and a "W×H px" label for each measurement. |
~/measure-export.css |
E | A :root block with the palette as custom properties (--color-1, --color-2 ...), when there is a palette, and a comment for each measurement with its size and start point. |
~/measure-export.json |
E | The screen size, each measurement's points, width and height, and the palette's hex values. |
6. Sessions and settings files
| File | What it keeps |
|---|---|
~/.config/gamut/measure/session.json |
The measurements and the palette. Written when the overlay closes, read when it opens. |
~/.config/gamut/measure/config.json |
The dialog's settings, written on OK and read when Gamut starts. A few settings have no control in the dialog and can only be changed here: snap_radius (the 12-pixel edge snap), audit_unit (the 8 of the audit), grid_columns and grid_gutter (the column grid's 12 and 16), label_font_size (the size of the overlay's labels, 12), and the colors of the grid and the crosshair. |
The folder is the measure/ folder of Gamut's folder, which is $XDG_CONFIG_HOME/gamut/ when $XDG_CONFIG_HOME is set to a full path. Earlier versions kept these files in ~/.local/share/measure/; Gamut reads them from there while the new ones are missing.
The overlay's own colors come from the current theme's [app] section (see Settings and Themes).
7. Monitors and requirements
The overlay covers the whole X screen, across every monitor; faint lines mark where one monitor meets the next. Positions, rulers, breakpoints and percentages count from the top left of the whole screen; the list of keys and the short messages appear on the monitor under the pointer.
To show the live screen underneath, the overlay runs its own small OpenGL compositor. That needs the XComposite, XDamage and XFixes extensions and GLX with texture-from-pixmap. A compositor that is already running (picom, for example) is asked to stop while the overlay is open. Where this is not possible, the overlay shows a still picture of the screen taken when it opened. To follow the pointer between clicks it needs the X server's RECORD extension.
8. With the Design window
After recoloring a page in the Design window, open the overlay over it: W checks the new colors' contrast, I and S check the spacing, and the Design window's Vision list shows the page as people with a color vision deficiency see it.
9. Known limitations
- Measurements are the width and height of a box; there is no diagonal length.
- P, W and the hex readout read the picture taken when the overlay opened (only the area under the loupe is refreshed while the loupe is on), so a color that changed since then is read as it was.
- Without the compositor the screen under the overlay is a still picture and never updates, so difference mode shows no changes.
- Window snapping moves every window, the dialog too, and a window that closed can still be a snap target until the overlay is opened again.
- Copied text is lost when the overlay closes, unless a clipboard manager keeps it.
- The compositor that was asked to stop is not started again when the overlay closes.
