XCOLOR(1)

πŸ“¦ version 0.5.1, in arch rolling, nixos 26.05, nixpkgs unstable

πŸ’… 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 for NAME are hex, HEX, hex!, HEX!, rgb, and plain. 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 for SELECTION are clipboard, primary and secondary. If SELECTION is not supplied, clipboard is used.
  • -S, --scale β€” magnification scale of the picker, defaults to 8.
  • -P, --preview-size β€” pixel size of the picker, defaults to 255.
  • -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 hexadecimal
  • hex! β€” compact lowercase hexadecimal
  • HEX! β€” compact uppercase hexadecimal
  • rgb β€” decimal RGB
  • plain β€” 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, xcolor forks into background when --selection mode is used. This behavior can be disabled by defining the XCOLOR_FOREGROUND environment 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