- C 99.9%
- Makefile 0.1%
- xtk_entry.c from xtk: the right-click menu of a text field closed as soon as it opened. The menu's own keyboard grab sends the field a FocusOut, and the field hid its menu on it. - VERSION, README.md, the man page and CHANGELOG.md: 1.9. - The version is 1.9. |
||
|---|---|---|
| artwork | ||
| screenshots | ||
| src | ||
| wpe-backend | ||
| CREDITS.md | ||
| gamut.c | ||
| gamut.desktop | ||
| INSTALL.md | ||
| LICENSE | ||
| logo.png | ||
| Makefile | ||
| README.md | ||
Gamut
Gamut is a native X11 color-engineering tool for Linux. It provides a precision color picker, a multi-model harmony generator, a gradient builder with perceptual interpolation, a full-screen measurement overlay, and a live web-design preview — all in a single compact application built without GTK, Qt, or any large widget toolkit.
Everything is built on Xtk, a self-contained C17 Xlib widget library written for this project, with LCMS2 for ICC-accurate conversions and WPEWebKit 2 for the embedded browser.
- Version: 1.9 (see CHANGELOG.md)
- License: Artistic License 2.0 (see LICENSE)
The three windows
┌─────────────────────────────────────────────────────────────────┐
│ MAIN WINDOW (the hub) │
│ ┌──────────┐ ┌──────────────────────────────────────────────┐ │
│ │ Magnifier│ │ Sliders · Spinbuttons · Hex · Colorspace │ │
│ └──────────┘ └──────────────────────────────────────────────┘ │
│ ┌─────────┬──────────┬─────────┬────────┬──────────┐ │
│ │ Harmony │ Gradient │ Theming │ Values │ Settings │ (tabs) │
│ └────┬────┴────┬─────┴─────────┴────────┴──────────┘ │
└───────┼─────────┼───────────────────────────────────────────────┘
│ │
│ palette │ gradient preview + CSS string
│ colors │ (pushed on every gradient change)
▼ ▼
┌──────────────────────────────┐ ┌─────────────────────────────┐
│ DESIGN WINDOW │ │ MEASUREMENT OVERLAY │
│ WPEWebKit browser viewport │ │ Full-screen, all monitors │
│ Color panel (palette slots, │ │ Distance/angle/WCAG/loupe │
│ gradient strip, color map) │ │ SVG/CSS/JSON export │
│ Inspector · CVD filter │ │ │
└──────────────────────────────┘ └─────────────────────────────┘
One color is the ground truth: the current color is always stored internally as sRGB, and every widget — sliders, hex entry, harmony wheel, values tab, gradient stops — is a view onto that one color. Changing it anywhere propagates everywhere, and data flows in both directions: dropping a page color back onto the Design Window panel in Set Base mode regenerates the entire harmony palette upstream.
Features
Color picking and editing
- Live zoom magnifier that tracks the pixel under the cursor; one-click Pick freezes it as the current color, with an optional Hide on pick mode so Gamut's own windows can't pollute the sample
- Gradient-track sliders and spinbuttons in 18 selectable color models: RGB, Linear sRGB, RYB v1/v2, HSL, HSV, Display P3, Adobe RGB, ACEScg, Rec.2020, ProPhoto RGB, L*a*b*, LCh(ab), OKLab, OKLCh, LCh(uv), JzAzBz, CAM16-UCS — each slider track previews exactly what moving it will do
- Hex entry (
#RRGGBB,#RGB,#RRGGBBAA, or CSSrgb(),rgba(),hsl()andhsla()), optional alpha row with checkerboard track, and a live/confirmed swatch strip for before/after comparison
Harmony generation
- Interactive color wheel with SV triangle, driven by 18 wheel models (RGB, two artist RYB variants, HSL, HSV, six wide-gamut RGB spaces, and six perceptual spaces) — a "complementary" pair in OKLCh is perceptually opposite, not numerically opposite
- 12 scheme types: Single, Complementary, Analogous, Split-Complementary, Triadic, Square, Tetradic, Accented Analogous, Compound, Double Triadic, Equidistant N (2–12), Paired N×2 — with configurable companion distance and step counts
- Up to 12 swatches with click-to-copy hex labels; every swatch is a drag source for the Design Window
Gradient editor
- Multi-stop gradient bar fed by the harmony palette: add, move and remove stops, and set each stop's easing, opacity and midpoint
- 16 interpolation spaces (OKLCh, OKLab, LCh, L*a*b*, JzAzBz, CAM16-UCS, sRGB, Linear sRGB, HSL, HSV, and the wide-gamut RGB spaces), four hue-travel methods, four easing curves, linear/radial types, reverse, and opacity per stop
- 13 export formats: CSS4, CSS3, SVG, plain stop list, GLSL, HLSL,
Unity C#, Godot 4, JSON, JavaScript, Android
GradientDrawable, iOS Swift, GIMP.ggr
Color values
- The current color in 42 read-only entries across In Gamut, Wide Gamut, Perceptual, and Programmatic groups — including ready-to-paste code literals for C/C++, Python, Java/Kotlin, C#/Unity, Go, SDL2, OpenCV, Rust, GLSL, and Android, with the alpha where the format has one
- Select an entry and press Ctrl+C (or right-click it for Copy); configurable value separator
- The Theming tab shows every color of a stylesheet as a swatch to pick up or drag
Measurement overlay
- Full-screen, always-on-top overlay across all monitors, rendered through a built-in GL compositor (texture-from-pixmap desktop capture); input passes through, so any application can be measured
- Distance, angle, and caliper measurement; spacing inspector; WCAG 2.1 contrast checker; pixel-grid loupe; rulers; responsive breakpoints; before/after diff; color sampling into a palette; 8pt-grid audit; snap-to-grid and snap-to-edges; window snapping
- Measure with the middle mouse button or the S key; exports to SVG, CSS,
and JSON; settings and sessions persist in the
measure/folder of Gamut's folder (see Running)
Design window
- Embedded WPEWebKit 2 browser (via a custom bundled WPE backend) that renders local HTML/CSS files
- Drop harmony swatches on the color map in one of four drop modes (Fill All, Set Base, Assign, Sort), drag palette swatches or the live gradient strip onto page elements to restyle them in place; role names, per-color locks (right-click a palette swatch), and a color-map audit trail
- Live Mode recolors the page with every harmony change; colors set on single elements support Undo/Redo, and the result exports as a standalone stylesheet (File → Export CSS)
- Element inspector (DOM path + computed CSS) and color-vision-deficiency simulation (protanopia, deuteranopia, tritanopia, the -anomaly variants, achromatopsia)
Theming
- 14 built-in themes (Chocolate, Dark, Ember, Forest, Gold, Graphite, Light,
Midnight, Ocean, Rose, Rust, Slate, Teal, Violet) as standalone
.conffiles — duplicate one to create a custom theme - Every widget's colors, fonts, sizes, radii, and padding are configurable;
the Settings tab edits theme files, the ten editor themes and
gamut.confin-app with syntax highlighting and applies them on Save, no restart; a theme file changed by another program is applied at once
Building
Gamut builds with GCC (-std=gnu17) and pkg-config. See
INSTALL.md for the package list. Then:
make clean
make
This produces:
gamut— the applicationlibWPEBackend-gamut.so— the custom WPE backend used by the embedded browser (loaded from the executable's directory via$ORIGINrpath)
The build is warning-clean under
-Wall -Wextra -Wpedantic -Wconversion -Wshadow -Werror.
To install (binary, backend library, desktop entry, icons and man page
under PREFIX, which defaults to /usr):
sudo make install
sudo make uninstall removes the same files. See
INSTALL.md for PREFIX/DESTDIR packaging details.
Running
./gamut
On first run Gamut generates its configuration tree and help pages. Its
folder is $XDG_CONFIG_HOME/gamut/ when XDG_CONFIG_HOME is set to a full
path, otherwise ~/.config/gamut/ (written so below). Runtime files:
| Path | Contents |
|---|---|
~/.config/gamut/gamut.conf |
Preferences (active theme, editor theme) |
~/.config/gamut/themes/*.conf |
Visual themes, live-editable |
~/.config/gamut/editor_theme/*.conf |
The colors of the Settings tab's ten editor themes |
~/.config/gamut/help/ |
Generated multi-page HTML help |
~/.config/gamut/state.dat |
Window geometry, active tab, checkbox states |
~/.config/gamut/zoom.xpm |
The magnifier's last picture |
~/.config/gamut/file_dialog.txt |
What the Open CSS File dialog remembers: favorites, hidden files, columns and sort |
~/.config/gamut/measure/config.json |
Measurement settings |
~/.config/gamut/measure/session.json |
Measurement sessions (files of earlier releases in ~/.local/share/measure/ are read when these are missing) |
Documentation
- User manual — every window, tab, setting and key, in the
wiki (made from the
pages in
doc/, which any browser can open too) - Built-in help — multi-page HTML written to the
help/folder of Gamut's folder (About, Main Window, Measurement Window, Design Window, and the full Architecture Reference), viewable in the Design Window via Help → View Help or in any browser - MANUAL.md — the complete widget and architecture reference (source of the generated Architecture Reference help page)
- API docs — can be generated with Doxygen from the headers in
src/
The Xtk toolkit
The src/ directory contains Xtk, the widget library Gamut is built on:
button, entry, label, slider, spinbutton, checkbox, radiobutton, swatch,
combobox, notebook, menu bar, popup menus, textview, statusbar,
tooltip, panel, grid layout, file dialog, scheme wheel, zoom, and
browser widgets.
Design principles:
- All drawing funnels through a Cairo-style polygon layer (
xtk_draw) — no raw Xlib drawing primitives in widget code - All window-drawing widgets are double-buffered via the X11 DBE extension
- All text rendering uses Xft; high-volume pixel transfers use XShm
- Every widget owns its theme block with a config init/parse/write trio, so
themes load, live-reload, and round-trip through
.conffiles without losing user edits - Public API is uniformly
xtk_-prefixed with NULL guards on entry points
Project layout
| Path | Contents |
|---|---|
gamut.c |
Application: main window, event loop, wiring |
src/ |
Xtk widget toolkit, color math, compositor, help generator |
wpe-backend/ |
Custom headless WPE backend (libWPEBackend-gamut.so) |
artwork/ |
Icon and wordmark SVG masters + rendered PNGs |
Makefile |
Build (all, clean, install, uninstall) |
License
Artistic License 2.0 — see LICENSE.
Gamut builds on ideas and code from earlier free-software projects; see CREDITS.md for the list of original projects and their licenses.



















