A script that provides a working color picker for wayland and wlroots by leveraging grim and slurp.
- Command
wl-color-picker
- Select position on screen and open color picker window - Command
wl-color-picker clipboard
- Select position on screen without opening color picker window, just copy selected color to clipboard
This script is possible by the information provided on the following sites:
- https://www.trst.co/simple-colour-picker-in-sway-wayland.html
- https://unix.stackexchange.com/questions/320070/is-there-a-colour-picker-that-works-with-wayland-or-xwayland/523805#523805
The icon was taken from the gcolor3 icon shipped with the papirus icon theme, so all credits go to the papirus icon designers.
- slurp - provides the screen location picker
- grim - uses the location provided by slurp and generates a pixel
- convert - uitlity from imagemagick to make the pixel a hex number (graphicsmagick is also supported)
- zenity - display a nice color selector dialog where the picked color can be tweaked further
- wl-copy - copy the selected color to the clipboard
ArchLinux - install from AUR
yay -S wl-color-picker