A simple Rust-based tool that captures the color of a pixel at your cursor position and copies it to your clipboard as a HEX code.
- Cross-platform: Works on X11 and Wayland (Linux).
- Clipboard support: Copies the color code to your clipboard.
Install Rust Then, install dependencies for your display server:
For X11:
maim xdotool xclipFor Wayland:
grim slurp wl-clipboardClone and install the tool:
git clone https://github.com/6z7y/colpik.git
cd colpik
make installRun it with:
colpik- Run
colpik. - Click on the screen to select a pixel.
- The HEX color code (e.g.,
#FF0000) is printed to the terminal and copied to your clipboard.
Example:
$ colpik
#1A2B3C-
"Command not found" errors:
- Ensure dependencies are installed.
- Verify with:
maim --version(X11) orgrim --version(Wayland).
-
Clipboard not working:
- X11: Install
xclip(sudo apt install xclip). - Wayland: Install
wl-clipboard(sudo apt install wl-clipboard).
- X11: Install
-
Color not captured:
- Check your display server:
echo $XDG_SESSION_TYPE. - Ensure
/tmphas write permissions for/tmp/imgpik.png.
- Check your display server:
Q: Does it work on Windows/macOS?
A: Currently supports Linux only (X11/Wayland).
Q: How do I build without make?
A: Use:
cargo build --release
./target/release/colpik