LinuxCommandLibrary

colorpicker

Select colors from the screen

TLDR

Launch colorpicker and print the hexadecimal and RGB value of each clicked pixel to stdout

$ colorpicker
copy

Only print the color of one clicked pixel and then exit
$ colorpicker --one-shot
copy

Print the color of each clicked pixel and quit when a key is pressed
$ colorpicker --quit-on-keypress
copy

Only print the RGB value
$ colorpicker --rgb
copy

Only print the hexadecimal value
$ colorpicker --hex
copy

SYNOPSIS

grabc

DESCRIPTION

The grabc command, often serving the role of a command-line colorpicker on Linux, provides a minimalistic way to identify colors from the X display using your mouse. When executed, it pauses and waits for a single mouse click anywhere on the screen. Upon clicking, grabc immediately identifies the color of the pixel directly under the mouse cursor and prints its hexadecimal RGB representation (e.g., `#RRGGBB` or `RRGGBB` depending on version/environment) to standard output. This utility is particularly efficient for tasks like web development, graphic design, or scripting where you need to quickly acquire a precise color value from an application or an image displayed on your screen without resorting to complex graphical tools. Its simplicity aligns with the suckless philosophy of doing one thing well.

CAVEATS

grabc is typically part of the suckless-tools package and might not be installed by default on all Linux distributions. It requires an active X server environment to function, meaning it cannot be used in a purely command-line (TTY) session without X. Its output is generally limited to hexadecimal RGB format without options for other color spaces (e.g., HSL, CMYK) or decimal RGB values.

HISTORY

grabc is a utility developed under the suckless philosophy, which advocates for software that is simple, small, and focuses on doing one thing well. Its development is rooted in the tradition of creating highly efficient and user-centric tools for the Unix-like environment, often resulting in a lean codebase and minimal features, ensuring stability and speed. It emerged as a solution for quick color grabbing without the overhead of larger graphical applications, consistent with other utilities in the suckless-tools collection.

SEE ALSO

xcolor(1), gcolor2(1), xclip(1), xsel(1), convert(1)

Copied to clipboard