LinuxCommandLibrary

hyprpicker

Pick screen color

TLDR

Pick a color in the default (hex) format

$ hyprpicker
copy

Pick a color and output in a specific format
$ hyprpicker [[-f|--format]] [hex|rgb|hsl|hsv|cmyk]
copy

Copy the picked color to the clipboard
$ hyprpicker [[-a|--autocopy]]
copy

Disable colored output (print plain text only)
$ hyprpicker [[-n|--no-fancy]]
copy

Store the picked color in a shell variable
$ [color]=$(hyprpicker [[-f|--format]] [hex])
copy

Display help
$ hyprpicker [[-h|--help]]
copy

SYNOPSIS

hyprpicker [options]

PARAMETERS

-h, --help
    Displays a help message and exits.

-v, --version
    Shows version information about `hyprpicker` and exits.

-s, --splash
    Activates or forces the display of a magnifying glass splash screen during color selection, aiding in precise pixel picking.

-f format, --format format
    Specifies the desired output format for the picked color. Common options include hex (default), rgb, hsl, hsv, and cmyk.

-a, --autocopy
    Automatically copies the selected color value to the system clipboard upon picking.

-r, --raw
    Outputs only the pure color value without any descriptive prefixes or trailing newline characters, making it ideal for scripting.

-z factor, --zoom factor
    Sets the zoom level for the picker cursor. For example, -z 4 would zoom in 4x.

-p digits, --precision digits
    Defines the number of decimal places for floating-point color values (e.g., for RGB or HSL channels).

--
    Signals the end of command-line options, useful if a color format or other argument could be mistaken for an option.

DESCRIPTION

`hyprpicker` is a lightweight and efficient color picker tool specifically designed for Wayland environments, with strong ties to the Hyprland compositor. It enables users to effortlessly select any color visible on their screen and retrieve its value in various common formats.

The utility is known for its speed and simplicity, often displaying a magnifying glass (`--splash`) to aid in precise pixel selection. Its primary function is to provide a quick way for developers, designers, or anyone needing a specific color code to grab it directly from their display, supporting output formats like hexadecimal, RGB, HSL, HSV, and CMYK. It also offers convenient features such as automatically copying the selected color to the clipboard and raw output for scripting purposes.

CAVEATS

  • Primarily designed for Wayland compositors. While some efforts might exist for Xorg compatibility via `grim`/`slurp` emulators, its native and most robust functionality is on Wayland.
  • Requires a Wayland compositor that implements the `wlr-screencopy-v1` and `wlr-data-control-v1` protocols for screen grabbing and clipboard access respectively.
  • Color profile management is usually left to the compositor; `hyprpicker` simply reports the raw pixel color.

USAGE EXAMPLES

To pick a color and print it in hexadecimal (default):

hyprpicker


To pick a color and copy it directly to the clipboard:
hyprpicker -a


To get the color in RGB format:
hyprpicker -f rgb


To get a zoomed-in picker and output raw hex for scripting:
hyprpicker -z 4 -r

WAYLAND INTEGRATION

As a Wayland-native application, `hyprpicker` leverages Wayland protocols for screen content access and clipboard functionality. This ensures secure and efficient operation within modern Wayland desktop environments, adhering to the Wayland philosophy of explicit permissions and client isolation. It typically works out-of-the-box on `wlroots`-based compositors like Hyprland, Sway, and Wayfire.

HISTORY

`hyprpicker` emerged as part of the Hyprland ecosystem, a dynamic tiling Wayland compositor. Its development was driven by the need for a native, fast, and minimalist color picker that integrates seamlessly with Wayland's security model and protocols, specifically `wlroots` based environments. Before `hyprpicker`, Wayland users often relied on less integrated solutions or lacked a native tool, especially given the difficulties of screen grabbing on Wayland compared to Xorg. It quickly became a go-to utility for Hyprland users and gained popularity in other `wlroots`-based Wayland setups due to its efficiency and straightforward functionality.

SEE ALSO

grim(1), slurp(1), hyprctl(1), xcolor(1)

Copied to clipboard