1 Theming and Values
liquibyte edited this page 2026-11-19 16:23:31 -06:00
This file contains ambiguous Unicode characters

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.

Theming and Values

Two tabs of the main window. The Theming tab shows the colors of a stylesheet as swatches you can pick up and drag; the Values tab shows the current color in 42 forms, ready to copy.

1. The Theming tab

While the Theming tab is showing, two buttons appear at the right of the tab bar: Open CSS and Close CSS.

Open CSS opens the "Open CSS File" dialog, in the folder of the last file you opened (its filter is "CSS files"). Gamut reads every color written in the file and shows each different one once, in the order it first appears, up to 200:

  • #rgb, #rrggbb and #rrggbbaa;
  • rgb() and rgba() with whole numbers, and hsl() and hsla() with a percent sign after the saturation and the lightness, all with commas between the numbers.

Colors inside comments (/* ... */) and inside quoted strings are skipped.

The alpha of a color is not used. Each color gets a swatch with its hex value under it. A color set by a custom property, such as --accent: #e94560;, also shows the property's name above the hex value. The swatches fill the tab in as many columns as fit; when there are more than the tab can show, a scrollbar appears at the right, and the mouse wheel scrolls.

  • Click a hex value or a name to make that color the current color; the text is also copied to the clipboard.
  • Drag a swatch onto the Design window's Color Map, as you would a harmony swatch. In Assign mode its name (or hex value) becomes the palette color's role.

Close CSS clears the tab. The file that is open when Gamut closes is opened again at the next start, if it is still there.

The dialog remembers its favorites, whether it shows hidden files, its columns and its sort order in file_dialog.txt in Gamut's folder (see Tips and Troubleshooting), so they are the same the next time you open it.

2. The Values tab

The Values tab shows the current color in 42 forms, in four groups. The radio buttons at the bottom right choose the group; those at the bottom left choose what goes between the numbers: Comma+Spc (a comma and a space, the first choice), Comma, Space or Tab. Both choices are kept between runs.

Each value is in a read-only field. Select it with the mouse (or Ctrl+A in the field) and press Ctrl+C, or right-click it for a menu with Copy and Select All.

Group Forms (as labeled)
In Gamut (9) sRGB: R, G, B (0 to 255); Linear sRGB: R, G, B; RYB v1 and RYB v2: H°, S%, L%; HSL: H°, S%, L%; HSV: H°, S%, V%; CMYK: C, M, Y, K (0 to 1); YPbPr 601: Y’, Pb’, Pr’; YCbCr 709: Y, Cb, Cr
Wide Gamut (7) Display P3, Rec.2020 and Adobe RGB: R, G, B (0 to 255); ACEScg and ProPhoto: R, G, B (0 to 1); XYZ D65: X, Y, Z; Yxy: Y, x, y
Perceptual (11) CIE Lab D65: L, a, b; LCh: L, C, h°; Hunter Lab: L, a, b; CIE Luv D65: L, u, v; LCh(uv): L, C, h°; OKLab: L, a, b; OKLCH: L, C, h°; JzAzBz: Jz, Az, Bz; JzCzHz: Jz, Cz, Hz°; CAM16-UCS: J’, a’, b’; CAM16-UCS: J’, C’, h°
Programmatic (15) Ready-to-paste code, listed below.

Degrees and percents have two decimals, most other values four, and the JzAzBz and JzCzHz values five. The CAM16-UCS values follow the viewing conditions chosen on the Harmony tab; the others use the D65 white point.

Label Example for opaque #3A7BD5
C/C++ (RGB) 0x3A7BD5
C/C++ (ARGB) 0xFF3A7BD5
C (RGBA u8) {58, 123, 213, 255}
C (RGBA f) {0.227f, 0.482f, 0.835f, 1.000f}
Python (RGBA) (58, 123, 213, 255)
Python (RGBA f) (0.227, 0.482, 0.835, 1.000)
Java / Kotlin (RGBA) new Color(58, 123, 213, 255)
C# / Unity (RGBA f) new Color(0.227f, 0.482f, 0.835f, 1.000f)
Go (RGBA) color.RGBA{R: 58, G: 123, B: 213, A: 255}
SDL2 (RGBA) SDL_Color{58, 123, 213, 255}
OpenCV (BGRA) cv::Scalar(213, 123, 58, 255)
Rust (RGBA) [58u8, 123, 213, 255]
Rust (RGBA named) Rgba::new(58, 123, 213, 255)
GLSL (RGBA f) vec4(0.227, 0.482, 0.835, 1.000)
Android (ARGB) Color.argb(255, 58, 123, 213)

The forms with an alpha use the current color's alpha. The separator choice does not change the Programmatic forms.

3. Known limitations

  • The Theming tab does not read named colors (such as rebeccapurple), space-separated rgb(), or newer color syntax such as oklch().