palcomp(1)
๐ palcomp โ palette composer โจ (thatโs palcomp(1) from hxtools, bestie) ๐
๐ NAME ๐
palcomp โ palette composer ๐
๐ฆ SYNTAX ๐ฆ
palcomp [commands...]
โจ DESCRIPTION โจ
Okay so palcomp makes palettes for terminals, and the whole vibe is lowkey scientific but also very slay. The big realization is this: programs running inside a terminal that use console_codes(4) to set colors rely on the contrast of the colors produced by a color pairing being proportional to the contrast those two codes have when using the VGA color palette. So for that reason, a mainstay of this program is to operate using a colorspace with perceptual uniformity, i.e. CIELAB/LCh. Iconic behavior, no cap.
Most commands operate on a single palette, but bestie, you can store multiple palettes in memory. The current working palette is called "0" (cf. loadreg/savereg). ๐ซถ
๐ COMMANDS ๐
b0
Set color 0 to actual black. Thatโs it. Black black. ๐ค
bg
Emit a -bg parameter upon xterm, and use color 0.
blend=pct,name
RGB-blend the current palette with another one. It performs:
output := curpal*(100-pct) + secondpal*pct
pct should be in the range 0..100. Math but make it fashion. ๐งฎโจ
ct
Print the 16-color table.
ct256
Print 256-color cubes and tables.
cxl
Print a contrast analysis of the palette based on brightness differences.
cxa
Print a contrast analysis of the palette based on Myndex Advanced Perceptual Contrast Algorithm (APCA W3). Be aware of the HelmholtzโKohlrausch effect, where certain highly saturated colors appear brighter than their measured luminance would imply; in other words, a color pair might appear more legible than the computed contrast value indicates. ๐
eq[=b]
Equalize (equal-space) the lightness values of the paletteโs colors. The b parameter (0 <= b <= 100) specifies the mandatory lightness difference from the darkest to 2nd darkest color. In practice, b specifies the lightness value that blue is to be assigned. If b is absent, uses b=1/16. Cute defaults. ๐
fg
Emit a -fg parameter upon xterm, and use color 7.
hueadd=h
Rotate colors using LCh space. (0 <= h < 360)
hueset=h
Set the hue of all colors using LCh space.
ild=t
Set the white point to be a series D illuminant at color temperature t. (t should be in the range 4000..25000 K). This only has an effect for the "cxa" command. Commands like hueadd/set/litadd/mul etc. all use libbabl, which hardcodes D65. The default white point used by palcomp is ild=6500. Note that D65 is not exactly 6500 K, due to changes of the Planck constant between when Illuminant D was first defined and 2019. Science lore, iykyk. ๐ฌ
inv16
Perform color inversion the way Norton Icon Editor did it. Retro moment. ๐
lch
Emit the LCh form of the palette to stdout (no particular formatting). Raw beauty. โจ
litadd=r
Change colorsโ brightness using LCh space.
litmul=r
Multiply colorsโ brightness using LCh space.
litset=r
Set colorsโ brightness using LCh space.
loadpal=
Load RGB palette from a file. xfce4-terminal *.theme files and termux *.properties files are understood. File format detective work: handled. ๐
loadreg=name
Set the working palette ("0") to the contents of the named palette.
satadd=r
Change colorsโ saturation using LCh space.
satmul=r
Multiply colorsโ saturation using LCh space. In effect, with r<1, this causes a desaturation of colors; r=0 leads to gray. Desaturated era. ๐ฉถ
satset=r
Set colorsโ saturation using LCh space.
savereg=name
Save the current working palette ("0") to a new name.
hsltint=h,s,l
Map the (LCh) brightnesses onto a color line through the HSL cylinder that goes from black to the chosen color. Parameter ranges are:
0 <= h < 360
0 <= s < 1
0 <= l <= 1
When using s<=0.5, this produces a black-to-{color} ramp; when using s==1, this produces a black-to-{color}-to-white ramp. Ramp era, honestly. ๐
hsltint produces a somewhat more contrasty result than manipulating hue and saturation in LCh. Compare:
palcomp vgs satset=100 hueset=120 emitpalcomp vgs hsltint=90,1,0.5 emit
hsltint=#rrggbb[,l]
A different syntax for the hsltint operation. First, the RGB value for the tint color is converted to HSL. The so-computed L value can be overridden with the optional ,l suffix. Afterwards, behaves like hsltint=h,s,l. Same slay, different spelling. ๐
lchtint=h,s,l / lchtint=#rrggbb[,l]
Replace the LCh hue and saturation by the base color given in HSL or RGB. The LCh L value is retained as-is. Keep the lightness, swap the vibe. ๐จ
loeq[=b[,g]]
Equalize (equal-space) the lightness values of the paletteโs low-intensity colors plus darkgray. The b parameter (0 <= b <= g <= 100) specifies the mandatory lightness difference from the darkest to 2nd darkest color. In practice, b specifies the lightness value that blue is to be assigned. The g parameter (b <= g <= 100) specifies the lightness that the brightest color of the low-intensity section is to use (in practice, the lightness for grey). If g is absent, defaults to g=88.88; this is so that gray is still a little less intense than white. If b is absent, uses b=11.11. Very specific, very demure. ๐ฉถโจ
vga
Loads the standard VGA palette.
vgs
Loads a full-saturated VGA palette.
win
Loads the standard Windows palette.
xfce
Emit the palette as a line for an xfce4-terminal theme file.
xterm
Emit the palette as xterm command line options. Use e.g. xterm $(palcomp vga hueset=120 xterm) to utilize. Shell substitution moment. ๐
๐ EXAMPLES ๐
Amber tint via LCh color space:
palcomp vgs lchtint=#ef951d fg b0 emit
Black-to-green ramp (tint via HSL color space):
palcomp vgs hsltint=120,1,0.5 emitpalcomp vgs hsltint=#00ff00 emit
Black-to-green-white ramp (tint via HSL color space):
palcomp vgs hsltint=120,1,1 emitpalcomp vgs hsltint=#00ff00,1 emit
๐ซถ CAVEATS ๐ซถ
Lightness in LCh space behaves a bit counterintuitive. When (saturation) c>0, then L=0 does not mean black, e.g.:
$ palcomp vgs lchtint=#0000ff stat
{-0.000000,131.208094,301.364692}
ColorPalette=#0000a9;...
As a consequence, one needs to manipulate (shift and stretch) the L channel values more after lchtint, for example by using litadd and litmul commands:
palcomp vgs lchtint=#0000ff litadd=-42 litmul=1.74 lch xfcepalcomp vgs lchtint=#0080ff litadd=-25 litmul=1.49 lch xfce
Stretching the brightness this way has the side-effect that all colors get a bit darker, which may be undesirable. Instead of combining a tint with litadd and litmul, I can recommend to force color 0 to black using the b0 command. ๐ค
๐ฅ SEE ALSO ๐ฅ
hxtools(7) โ the whole hxtools family is right there, bestie. Go browse. ๐ซถ
๐ซถ Cute little sign-off: this is source/versionhxtools, dated2022-10-23, and itโs thepalcomp(1)manual page signing off. Bye bestie, go make your terminal palette iconic ๐โจ
๐ฆ where this page comes from
- opensuse-leap 16.0: consoleet-utils 1.7-bp160.1.13 ยท GPL-3.0-or-later AND MIT
- opensuse-leap 16.0: consoleet-utils 1.7-bp160.1.13 ยท GPL-3.0-or-later AND MIT
- opensuse-leap 16.0: consoleet-utils 1.7-bp160.1.13 ยท GPL-3.0-or-later AND MIT
- opensuse-leap 16.0: consoleet-utils 1.7-bp160.1.13 ยท GPL-3.0-or-later AND MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms