- 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. - xtk_richtext.c from xtk: in a code block a click, a drag, Up and Down measured the line in the body font while it is drawn in the monospace one, so the caret and the selection landed on other characters than the ones under the pointer. A drag whose button release went elsewhere now ends when the button is up. - The version is 1.11. |
||
|---|---|---|
| icons | ||
| screenshots | ||
| src | ||
| vendor | ||
| LICENSE | ||
| logo.png | ||
| Makefile | ||
| palette.desktop | ||
| README.md | ||
Palette
Palette is a color and theme design tool for Linux/X11. Pick colors from anywhere on screen, build harmonies and gradients, keep favorites, and drop colors onto a live preview of real toolkit widgets to see a theme take shape.
It is built on xtk, a small self-contained C17 Xlib widget library
(in src/), not on GTK or Qt. The GTK2, GTK3, GTK4, TQt 3, Qt 4, Qt 5
and Qt 6 previews are real widget factories, built from source included
in this repository and embedded in the Mockup panel. One more preview
shows every xtk widget, and another a desktop in an Openbox, Blackbox or
Fluxbox theme, so Palette
themes itself too, and any other program built on xtk: one theme file
works in all of them.
Status: alpha. Things will change, break and move around. Reports of anything odd are welcome.
Screenshots
Each toolkit's preview in a light and a dark theme - with a different engine or widget style for each where the toolkit has them - in Palette's default layout, with a Paired harmony on #51A48C and the gradient made from it. The wiki has a full guide.
| Light | Dark | |
|---|---|---|
| GTK2 | ![]() |
![]() |
| GTK3 | ![]() |
![]() |
| GTK4 | ![]() |
![]() |
| TQt 3 | ![]() |
![]() |
| Qt 4 | ![]() |
![]() |
| Qt 5 | ![]() |
![]() |
| Qt 6 | ![]() |
![]() |
| xtk | ![]() |
![]() |
| Window Manager | ![]() |
![]() |
| Light | Dark | |
|---|---|---|
| GTK2 | installed Clearlooks, Clearlooks engine | installed Chocolate, Murrine engine |
| GTK3 | Arc | Adwaita Dark |
| GTK4 | Default | Default Dark |
| TQt 3 | Keramik scheme, Keramik style | Dark Blue scheme, Phase style |
| Qt 4 | Cleanlooks, Cleanlooks style | installed KvArcDark scheme, QtCurve (with Palette's colors) |
| Qt 5 | Qt Light, Windows style | Qt Dark, QtCurve (with Palette's colors) |
| Qt 6 | Qt Light, Breeze | Qt Dark, Kvantum |
| xtk | Light | Midnight |
| Window Manager | Wheat, as Openbox draws it | Dark, as Fluxbox draws it |
Building
Needs a Linux system with X11, GCC (with g++), make, and pkg-config.
On Debian, Devuan or Ubuntu:
sudo apt install build-essential pkg-config libx11-dev libxext-dev \
libxrender-dev libxft-dev libfontconfig-dev libfreetype-dev \
libxpm-dev libxcursor-dev
On other distributions, install the same development packages and
binutils. Fedora also needs glibc-static and libstdc++-static for
the previews.
Then, from the repository folder:
make
That builds palette and its previews: GTK2, GTK3, GTK4, TQt 3, Qt 4, Qt 5
and Qt 6,
with every library they need (GLib, cairo, pango, FreeType,
fontconfig, the X11 client libraries...) from the sources under
vendor/, into static programs. It uses every CPU and takes a few
minutes. The previews use nothing from your system but the compiler and
the C library, and leave only the programs and a small vendor/build/
behind, and vendor/toolkits/xtk-gallery, xtk's own preview. make clean removes
everything built.
Running
./palette
It runs straight from the folder it was built in, and can be started
from any directory; it finds its own files next to the program. Settings
are kept in ~/.config/palette/ (or $XDG_CONFIG_HOME/palette/ when that
variable is a full path).
To install it instead:
sudo make install # after make
That puts palette in /usr/bin, its previews in /usr/libexec/palette/
and their data in /usr/share/palette/. sudo make uninstall removes
them (your settings stay). make install DESTDIR=<folder> stages the
install in a folder, for packaging.
First run: the window opens at the default layout's size (1700x860, smaller on a smaller screen; see View > Reset Layout below). The Mockup panel's first drop-down chooses the toolkit, GTK2, GTK3, GTK4, Qt3, Qt4, Qt5, Qt6 or xtk, or Window Manager (Openbox, Blackbox or Fluxbox); the second picks a theme preset for it.
Using it
- Picker: Pick Color starts picking from the screen. Arrow keys move one pixel, click or Enter picks, Escape or a right-click cancels; Ctrl+Alt+Z starts a pick too. Live hex shows the hex value under the magnifier; Hide on pick hides the window while picking, however the pick started.
- Formats: the current color in a choice of color spaces (RGB,
Linear sRGB, RYB v1, RYB v2, HSL, HSV - the one color-space choice, which
the Harmony wheel follows too), each with its own ranges, plus hex. A
focused spin box steps with the mouse wheel. Its alpha slider sets the
Picker swatch's alpha only (the swatch shows it over a checkerboard and
carries it when dragged); its track runs from a checkerboard to the
current color, its handle is the current color, and a pick sets it back
to opaque.
- Favorites (the frame under the hex row): Add saves the Picker swatch - its color at its alpha then; dropping any swatch on the frame saves it too. A favorite keeps that alpha: moving the slider later doesn't change it. Right-click removes one. The frame grows a row at a time as colors are added.
- Harmony: a color wheel with thirteen schemes. Drag any marker to rotate the scheme (it becomes the primary, the current color); the swatches, in the gradient's order, can be dragged elsewhere. Free places up to 32 markers by hand, each with its own saturation and value, along the wheel from the first marker (the current color) counterclockwise to the last; while the gradient follows the harmony they're its stops, and moving a marker or its stop moves the other.
- Gradient: a gradient editor with CSS, SVG, GLSL and other output formats. Following the harmony, the current color is always its first stop (its last with Reverse). The bar runs 0-100% left to right under its stop markers; the square beside it shows the gradient at its angle (or radial). Stops not moved by hand stay evenly spaced between the fixed ones, so Add Stop spaces them evenly; a stop dragged or placed with Stop at stays put; Space Evenly spreads them all again. The strips below compare interpolation color spaces.
- Mockup: the real widget factory of the chosen toolkit, themed live.
Undo and Redo work on the preview's colors; Reset (after asking)
puts the toolkit's theme back to its defaults - every change, setting
and opened theme discarded, the first preset showing. A theme preset
sets its base colors. The gradient swatch next to Redo shows
the Gradient panel's gradient and can be dragged too.
- Apply To (after Engine) puts the theme shown - a preset or your edits - onto All Toolkits or one: the colors every toolkit names in its own way (the window and its text, fields, buttons, the selection, disabled text, links, tooltips, borders, error and success, hover and pressed), and between GTK3 and GTK4, or among the Qt versions, every variable, zone, effect and KDE color set they share. A target color its own formula already makes keeps the formula; a dark window gives GTK3 and GTK4 their dark stylesheets; engines and styles stay. Not carried: GTK's zones to other kinds of toolkit, GTK2's widget-class colors, gradients between kinds, fonts and settings. One Undo step; a target with unsaved changes is asked about first.
- GTK2: drag a swatch onto the grid of states and colors above the widgets - GTK2's gtkrc spec: bg/fg/base/text per state, plus buttons. Click a grid color to see what it colors: it blinks, together with every part of the widgets it paints. A swatch dropped straight onto a widget colors just that widget class (every GtkEntry, every GtkButton) in the grid color the spot takes from the default style; the grid stays what every other class uses. The gradient swatch dropped on a widget becomes its class's background image (GTK2's bg_pixmap, made the widget's size; saved themes get the image beside their gtkrc). GTK2's style properties (cursor and link colors, tree view row colors, focus lines, scrollbar and indicator sizes...) are in the Style panel's settings list with every engine, beside the engine's own (Clearlooks', oxygen-gtk's and QtCurve's too): each setting with its choices named by what they draw, and Default. Changes there wait for Apply (beside the button that shows the list), so the preview reloads once, not on every click. Every toolkit's list also has the KDE color scheme's settings it can show - the inactive-window and disabled-widget effects and the frame contrast - which Palette turns into colors as Plasma does for every program: Qt's Inactive and Disabled groups and shades, GTK3's and GTK4's unfocused and insensitive colors, GTK2's INSENSITIVE ones.
- GTK3: drag a swatch straight onto any part of the widgets. Every
element, state and color property the theme colors is its own drop
zone - a button's background apart from the window's, a hovered
button's apart from a pressed one's, text apart from borders. While
you drag, the zone under the pointer is outlined (a text color by one
box around its block of text), and the two lines under the buttons name it
(
button:hover - background) and the Adwaita color it follows (bg_color, fg_color, borders_color...). A drop colors just that zone. Turn the mouse wheel while dragging to go through everything else of that element: its other states (hover, pressed, checked, selected, disabled, unfocused window), its other parts (text, border, shadow, focus outline, text cursor) and the parts inside it (an entry's selected text, a button's label) - also parts Adwaita leaves transparent, and states it doesn't color separately. Hold Shift to outline and color everything that follows the same Adwaita color, as the real theme would. The gradient swatch drops onto backgrounds. (The widgets flicker once when a drag first reaches them, while Palette maps the zones.) An opened theme's own stylesheet adds its rules as zones too, named "set by ". GTK3's style properties GTK 3.24 still reads (list spacing, scroll bar and tab arrows, calendar spacing, toolbar buttons, the text cursor's width...) are in the Style panel's settings list. - GTK4: the same as GTK3, on GTK4's own widget factory and its Default theme (light, or the Default Dark preset); Shift follows the Default theme's colors. Its state list adds focus-visible and focus-within. Each toolkit keeps its own colors: switching between GTK3 and GTK4 loses nothing.
- Qt5: Qt's own Widget Gallery in the Fusion style, which draws
everything from Qt's palette: its 20 color roles (Window, Button,
Text, Highlight...) in three groups - Active, Inactive (the window
without focus; an embedded window usually shows this one) and
Disabled. Drag a swatch onto any part of the widgets: the role and
group painting it is outlined and named (
Inactive - Button), and a drop sets it. The wheel goes through every role painting that spot (the button's face, its label, its frame) and then those roles in the other groups. Shift+drop sets the Fusion color the spot follows (window, button, text, disabled_text...): every role and group using it changes, and what Qt derives from it follows too - Window's lighter and darker shades (Light, Mid, Dark, Shadow), as Qt computes them. The widgets don't flicker: the program maps its own parts. Ctrl+drop sets the role for that widget class only (every QPushButton), asQApplication::setPalette(palette, "QPushButton")does. The grid above the widgets holds KDE's color sets (Window, View, Button, Selection, Tooltip, Complementary, Header x Bg, Bg Alt, Fg, Inactive, Active, Link, Visited, Negative, Neutral, Positive, Focus, Hover) - what a.colorsscheme saves. Drop a swatch on a cell to set it; with the Breeze style (Qt6) the preview draws from these sets live, as Plasma does, and a click on a cell blinks it there. With any other style the grid is greyed: those styles don't draw with it - except its Effects row's first two cells, the colors KDE's effects mix in. - Qt6: the same, on Qt 6's own Widget Gallery; its palette has one more role, Accent (checked and progress indicators), which follows Highlight. Presets Qt Light and Qt Dark (Qt 6's own dark palette). The presets are colors only; the Engine dropdown picks the widget style (Fusion, Windows, Kvantum, Breeze...).
- Qt4: the same, on Qt 4's own Styles example (Qt 4.8) and its 20
roles, in Plastique by default. Presets are Qt 4's own styles'
palettes; its theme file is
Trolltech.conf, what qtconfig writes. Styles: Qt 4's own, Norwegian Wood, Kvantum and QtCurve. - Qt3: TQt 3 - Trinity's continuation of Qt 3, the toolkit of the
Trinity desktop (TDE) - on TQt's own Themes example, with TDE's widget
styles (Plastik, TDE's default, Keramik, HighColor, Light, Phase,
dotNET...) and TQt's own. Its palette has 16 roles (Qt 4's first 16),
built as TDE builds it: Light, Mid, Dark and Midlight follow Window, so
a Shift+drop on Window re-derives them. Presets are the color schemes
TDE ships. It opens and saves TQt's
qtrc(what TDE writes for programs outside it) and TDE color schemes (.kcsrc); there is no color-set grid and no style sheet (the Style panel's effects don't apply). - Window Manager: an Openbox, Blackbox or Fluxbox theme - one theme,
the Engine dropdown choosing the window manager. It decides what the
preview shows and the file Save writes; the theme stays the same, so
choosing another one converts it. A theme's images (Openbox's XBM
masks, Fluxbox's XPM and PNG pixmaps) come with themes anyone can have
made, so the preview has them taken apart in xtk's jailed worker, a
process that can read, write and reach nothing; without the jail they
are not drawn. The preview (Palette's own,
vendor/toolkits/wm-preview) is a desktop drawn the way that window manager draws its themes, every part it themes: a focused window over an unfocused one (titles, labels, handles, grips, borders), every button state it has, focused and not (Openbox: normal, hover, pressed, disabled, toggled and toggled hovered and pressed), a menu (its title, items, submenu bullets, the highlighted one, disabled ones, a separator, Fluxbox's underline), Blackbox's and Fluxbox's toolbar (Fluxbox's iconbar, focused, unfocused and empty, and its system tray) and slit, and Openbox's undecorated windows, window switcher and dialog buttons. Drop a swatch on any part: each part's colors are zones of their own (window.active.title - text.color, Openbox's names). A part's texture has one color unless it's a gradient, as in all three: a swatch dropped on a part's background makes it that solid color (its relief, bevel and border kept); only the gradient swatch sets a gradient. Window manager gradients have two colors (bg.color,bg.colorTo; Openbox's SplitVertical four, its MirrorHorizontal goes there and back), so in this format the swatch shows the Gradient panel's gradient as the dropdown beside it takes it - Vertical, Horizontal, Diagonal, Pyramid, SplitVertical... (the forms the Engine's window manager lacks are greyed out) - drawn as that window manager draws it, and a drop gives the part exactly that. Every part starts solid. The textures are the Style panel's effects -bgon a part (Raised, Flat or Sunken; Solid or a gradient - Vertical, Horizontal, Diagonal, Pyramid, SplitVertical...; Bevel2, Border, Interlaced) - and the whole theme's sizes (border.width,padding.width...),justifyand fonts, which go onstyleby themselves. The fonts are Blackbox's and Fluxbox's -window.font,menu.title.font,menu.items.font(theirmenu.frame.font),toolbar.font- fontconfig names as the styles write them (sans-9:bold, Fluxbox's:shadowkept) or X font names; the preview draws with them. An Openbox theme has none (Openbox's are itsrc.xml's): they're kept for the other two, and itsthemercgets none. Any of the three's files opens (the Engine follows it). Save As asks for a folder (New Folder makes one), then the theme's name, and makes<Name>/there with each window manager's own: Openbox'sopenbox-3/themerc(put<Name>in~/.themes), Fluxbox'sfluxbox/theme.cfg(that folder, renamed<Name>, in~/.fluxbox/styles), and a Blackbox (0.70) style,blackbox/<Name>(the file in~/.blackbox/styles). The window manager needn't be installed. It never writes over a theme Palette didn't write. Each is written with the nearest of what it lacks (Openbox's SplitVertical becomes Vertical, Blackbox's Elliptic becomes Pyramid, Openbox's window switcher becomes the toolbar). Installed themes (Openbox's in the theme folders,/usr/share/fluxbox/styles,/usr/share/blackbox/styles,~/.fluxbox/styles,~/.blackbox/styles) are in the Theme combo. A theme opened from a window manager's file shows its images too, read from beside it, not edited: Openbox's button and bullet.xbmmasks (in the button's image color) and Fluxbox's.pixmaps (XPM, PNG...) - a part's pixmap is drawn over its colors, as Fluxbox draws it, until a swatch is dropped on that part. Saving takes the images along for the window manager they came from: Openbox's masks are copied beside the savedthemerc; Fluxbox's pixmaps into the saved style's folder where they were relative to it (usuallypixmaps/), the savedtheme.cfgnaming them with the same.pixmapkeys - except a part a color was dropped on. Converting to another window manager takes no images (they're different kinds). - Kvantum themes (Qt4, Qt5, Qt6): with Kvantum showing a theme - from
a folder, or Kvantum's built-in Default (its files copied once into
~/.cache/palette/kvantum/Defaultby the Qt preview) - the theme's own colors are the drop zones: each color of its SVG (recolored everywhere the SVG uses it - the status line names the parts it draws) and each color of its kvconfig (the theme's palette, every widget's text colors, followed by the sections that inherit them). Colors only: shapes, gradients and opacity stay the theme's. Save As asks for a folder and a name and writes the Kvantum theme into the theme folder'sKvantum/(<Name>/Kvantum/<Name>.kvconfig), where Kvantum finds it; Save All does too, from Qt 6's, Qt 5's or Qt 4's. - xtk: xtk's own widget gallery - every widget, working, on ten
pages (buttons, text, ranges, lists, rich text, color, data,
graphics, docking, system) - in the theme being made. An xtk theme is 17 role colors (window, base,
button, border, accent, hover, active, ...) that every widget
follows, and any widget's own keys over them - 196 keys in 29
sections, every color a widget draws (the status bar, data grid,
graph and tooltip included). Drop zones work as in
GTK3: a drop colors that widget's key (
button - hover-background), Shift+drop the role it follows, the wheel steps through the widget's other keys. The gradient swatch dropped on a background makes it a gradient, for a 3D look; the Style panel's Effects add a bevel (highlight, shade). Presets: xtk's 14 (Chocolate, Dark, Ember, Forest, Gold, Graphite, Light, Midnight, Ocean, Rose, Rust, Slate, Teal, Violet), Palette's copies of them as starting points; then the other themes in Palette's themes folder, and xtk themes installed as GTK themes are (<Theme>/xtk/in~/.themes,~/.local/share/themes,/usr/share/themes). Save As writes the theme (default~/.config/palette/themes/), where View > Theme lists it: choosing one there themes Palette itself, at once. - Ctrl+click any part of a widget to find its color: the grid color blinks (GTK2), along with everything else it paints, or the zone is outlined and named for a moment (GTK3, GTK4, Qt5, Qt6, xtk). The widgets flicker briefly while Palette works it out. Hovered widgets show their hover colors.
- Style (in the Picker panel, under the swatch, headed "Style the
preview: Pick a part, then color it"): precise control over the Mockup
preview, no dragging needed. The order follows the work: Pick, then what
to show, then the state, then the part. The
wiki has
every control.
- Show settings: the engine's or style's settings list (above).
- Pick, then click a part of the preview to lock it: it stays outlined, and the status bar names it. Pick takes the part's normal look; for its hover or pressed look, press that state first. Escape or a right-click cancels a pick; Unlock lets go. While something is locked, a swatch dropped anywhere on the preview colors it.
- Keep open or hovered in the preview keeps up what a program shows only for a moment, or holds a part in its hover look, so it's picked and dropped on like the rest: Popover, Menu, Submenu, Context menu, Menu bar, Combo list, Tooltip, Dialog; Tab, Scroll bar, Slider, Spin arrow, Header and List row hovered; Status message, Drop target, Title button, Rubber band, Completion, Overlay, Splitter, Tab close, Menu arrow and Calendar - each greyed where its toolkit has none. Nothing shown goes away of itself: press the button again. With Pressed on, a held tab, handle, arrow or header shows pressed (its value never moves).
- Or choose a widget from the list lists the program's widgets (Refresh reads them again); choosing one frames it in cyan and locks its background, as a pick would.
- State buttons put the widgets into that state, each only where it
really happens: Hover and Pressed on what reacts to the pointer, Checked
by really checking, Selected by really selecting, Disabled and
Unfocused on everything, Focus, Mixed (half-checked) and Visited links.
GTK3, GTK4, Qt and xtk combine them (Qt: Disabled and Unfocused are its
Disabled and Inactive groups); GTK2 shows one at a time - its grid's
rows, plus Focus (
cursor-color) and Visited (visited-link-color); it has no colors for Mixed or Unfocused. With a state pressed, only that state's parts take drops and picks. - Part to color chooses which part of a widget a pick or a drop takes, wherever on it you point: Background, Text, Border, Shadow, Text shadow, Icon shadow, Focus ring, Cursor or Underline - so thin borders don't need exact aim. None pressed: what's under the pointer.
- The color is the Picker's swatch, at the Formats panel's alpha: drag it onto the preview, or Apply it to the locked part. Dragged, the big swatch hangs from its top-left corner, which marks where it lands. Transparent clears the locked part, Takes its color from links it to one of the theme's colors, and Reset gives it back to the theme.
- Other properties: any property, on the locked part's selector or
one typed in Selector (
button:hover,QCheckBox::indicator). Pick the property, then a value from the list (the swatch's color and the gradient fill in where a value has one), or type a value,property: valueor whole rulessel { prop: value }and Set; Clear gives it back. GTK: shadows, borders, outline, opacity, backgrounds, padding, margin, sizes, fonts, icons, transitions, GTK4's filter and transform. Qt: style sheet (QSS) rules on the widget class, saved beside the Qt theme file with its name (qt5/<Name>.qss, Qt 4'sqt4/Trolltech.qss). xtk: a bevel's highlight and shade. Window managers: a part's texture (bg), and the whole theme's sizes, justify and fonts, which go onstyleby themselves. If the preview can't read a value, its own parse error shows in the status bar. - A control that can't apply to the toolkit is greyed out; pointing at it says why in the status bar.
- Your changes lists everything colored or set on its own: click one to select it, or Revert it.
- The status bar along the bottom names what's under a dragged swatch, what's picked or locked, and the theme color it follows.
- Clicking a Harmony color's hex label copies it; the panel's header shows "copied" for a moment.
Panels can be dragged to other edges, beside or under another panel,
floated, or closed with their close icon; View brings a closed
panel back. The bottom edge runs under all three columns, or under two:
drop a panel in the bottom-left corner for left and center (the right
column then runs the full height), the bottom-right corner for center
and right, the bottom middle for all three. The outline shown while
dragging is where the panel will go. The layout, including which panel
is above or beside which, is kept between runs; View > Reset Layout
puts the panels back where they start: Picker top left, Mockup top
center, Formats over Harmony on the right, Gradient along the bottom
under Picker and Mockup. View > Theme lists Palette's own themes (the files in
~/.config/palette/themes/, and installed xtk themes); choosing one
restyles all of Palette at once.
| Key | Action |
|---|---|
| Escape | Close or cancel what's open: a menu, a dropdown, a dialog, a pick (it never quits) |
| Mouse wheel | Scroll the panel under the pointer (a focused spin box steps its value) |
| Ctrl+Z / Ctrl+Shift+Z, Ctrl+Y | Undo / redo the theme |
| Tab / Shift+Tab | Move to the next / previous text field shown (hex, Harmony, Gradient, Style) |
| Ctrl+C / Ctrl+V | Copy / paste in entry fields |
Files it writes
Everything goes under $XDG_CONFIG_HOME/palette/, which is
~/.config/palette/ when XDG_CONFIG_HOME isn't set or isn't a full path:
| File | Contents |
|---|---|
palette.conf |
Settings, the Mockup's themes and edits, panel state, favorites, the magnifier's colors and crosshair/square |
themes.dat |
Opened and saved theme files, presets, engines and styles |
gtk2-pixmaps/ |
Images of GTK2 gradient backgrounds |
themes/ |
Palette's own xtk themes (xtk's 14 presets written on first run); View > Theme chooses one |
dock_layout.txt |
Panel positions and sizes |
file_dialog.txt |
What the file dialogs remember: favorites, hidden files, columns and sort |
window.dat |
Window position, last color, zoom level |
last_zoom.dat |
The last magnifier capture |
Edit > Configuration opens palette.conf in the editor named under
[paths] (the desktop's own when that's empty); Palette reads it again
when it's saved. Deleting that folder resets Palette to its defaults.
Licenses
Palette is under the Artistic License 2.0 (see LICENSE). The third-party code under
vendor/ keeps its own licenses (LGPL, MIT and others); each project's
license files are next to its source.

















