XCOLOR(1)
π XCOLOR(1) β lightweight color picker for X11 π
okay bestie, welcome to the General Commands Manual page for xcolor, and it's literally giving tiny-but-iconic X11 color picker energy. β¨
πΈ NAME πΈ
xcolor β lightweight color picker for X11. slay. π
π¦ SYNOPSIS π¦
xcolor [-f NAME | -c FORMAT] [-s [SELECTION]] [-S SCALE] [-P PREVIEW_SIZE] [-v] [-h]
π DESCRIPTION π
okay so xcolor is a lightweight color picker for X11, no cap. Grab your mouse, select colors that are visible anywhere on the screen, and get their RGB representation. π
By default, the selected color gets printed to standard output. periodt. π«Ά
β¨ OPTIONS β¨
-f NAME,--format NAMEβ says what output format you want. Possible values forNAMEarehex,HEX,hex!,HEX!,rgb, andplain. Peep FORMATTING for what each one means. Conflicts with--custom.-c FORMAT,--custom FORMATβ gives a template for your custom output format. See CUSTOM FORMATTING for how the template syntax works. Conflicts with--format.-s [SELECTION],--selection [SELECTION]β saves output to an X11 selection. Possible values forSELECTIONareclipboard,primaryandsecondary. IfSELECTIONis not supplied,clipboardis used.-S,--scaleβ magnification scale of the picker, defaults to8.-P,--preview-sizeβ pixel size of the picker, defaults to255.-v,--versionβ print version information and exit.-h,--helpβ print help message and exit.
π¨ FORMATTING π¨
By default, the color values are printed in lowercase hexadecimal format. You can change the output format using the --format NAME switch. The possible NAME values are:
hexβ lowercase hexadecimal (default)HEXβ uppercase hexadecimalhex!β compact lowercase hexadecimalHEX!β compact uppercase hexadecimalrgbβ decimal RGBplainβ decimal with semicolon separators
The compact form refers to CSS three-letter color codes as specified by CSS Color Module Level 3. If the color is not expressible in three-letter form, the regular six-letter form will be used. π
π§ CUSTOM FORMATTING π§
The --format switch provides quick access to some commonly used formatting options. However, if custom output formatting is desired, this can be achieved using the --custom FORMAT switch. The FORMAT parameter specifies a template for the output and supports a simple template language. FORMAT templates can contain special expansions that are written inside %{...} blocks. These blocks will be expanded into color values according to the specifiers defined inside the block. Here are examples of valid format strings and what they might translate to:
Format String Example Output
%{r}, %{g}, %{b} 255, 0, 100
Green: %{-4g} Green: ---7
#%{02hr}%{02hg}%{02hb} #00ff00
%{016Br} 0000000000000011
Expansion blocks in format strings always contain a channel specifier (r for red, g for green, and b for blue). Additionally, they can contain an optional number format specifier (h for lowercase hexadecimal, H for uppercase hexadecimal, o for octal, B for binary, and d for decimal) and an optional padding specifier consisting of a character to use for padding and the length the string should be padded to. The diagram below illustrates how we can use these rules to decode a formatting template:
%{016Br}
| |||
| ||`- Channel (red)
| |`-- Number format specifier (binary)
| `--- Padding length (16)
`----- Character to use for padding (0)
The output is the contents of the red color channel formatted in binary and padded with zeroes to be sixteen characters long. π€―
πΏ ENVIRONMENT πΏ
XCOLOR_FOREGROUNDβ disable daemon mode. Because of the way selections work in X11,xcolorforks into background when--selectionmode is used. This behavior can be disabled by defining theXCOLOR_FOREGROUNDenvironment variable.
π AUTHORS π
- Samuel LaurΓ©n
<samuel.lauren@iki.fi> - Callum Osmotherly
<acheronfail@gmail.com>
π bye bestie β that was the 2018 XCOLOR(1) page from the General Commands Manual, mwah! π
π¦ where this page comes from
- arch rolling: xcolor 0.5.1-5 Β· MIT
- nixos 26.05: xcolor 0.5.1
- nixpkgs unstable: xcolor 0.5.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms