You are not logged in.
I'm looking for a ricing tool that I'm sure must exist but I'm having no luck finding through search queries. Basically, you would execute the program, a crosshair pops up on the screen, hover over a specific pixel and hit enter and a color code is output somewhere. In this way I won't have to hunt through config files for color codes to clean up my environment. Anyone know the best solution?
Thanks.
*** Solved! grabc is the software, thank you Wibjarm! ***
edit: still having issues
Last edited by synftw (2019-12-25 18:29:08)
Offline
Sounds like grabc is probably exactly what you want. Run it, click a pixel, recieve hex code on stdout.
Offline
Sounds like grabc is probably exactly what you want. Run it, click a pixel, recieve hex code on stdout.
Just installed off the aur and... that was EXACTLY what I was looking for!!! Thank you so much, this community is amazing.
Offline
Still having issues, it looks like grabc determines that everything is #000000 regardless of where I click (the use-case right now is fixing the powerline color inconsistencies I'm having with kitty tabs). Maybe some kind of a configuration issue?
https://i.imgur.com/oxYYZ0Y.png
Mod Edit - Replaced oversized image with link.
CoC - Pasting pictures and code
Last edited by Slithery (2019-12-25 18:36:27)
Offline
I've always used scrot and imagemagic for this - though I've never wanted to target a specific pixel as this is error-prone particularly in antialiased regions.
I just 'scrot -s' to get a small area, then use imagemagic to convert this to a color histogram (and sort by number of pixels of each color) to get the dominant color(s).
For example, this script will do it:
#!/bin/sh
scrot -s /tmp/getcol.png
convert /tmp/getcol.png \
-define histogram:unique-colors=true \
-format %c histogram:info:- | \
sort -nr | \
sed -n '1s/[^#]*\([^ ]*\).*/\1/p'Last edited by Trilby (2019-12-25 18:54:34)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Output of "grabc -d"?
Do you by any chance run a wayland session (sway?)?
Offline
Output of "grabc -d"?
Do you by any chance run a wayland session (sway?)?
For the center of a solid blue region it's:
[Debug]: Root Window Id: 0x000001a1
[Debug]: Target Window Id: 0x0200000e X,Y: +327+334
[Debug]: Color: #000000
#000000Offline
I have the same problem with grabc here. It sometimes works and sometimes doesn't. It seems to depend on the window. It worked on the Firefox window but didn't work on other places of the desktop. I tried disabling the compositor but that didn't help.
I use Xorg and xfwm4 and picom/compton.
Offline
#!/bin/sh scrot -s /tmp/getcol.png convert /tmp/getcol.png \ -define histogram:unique-colors=true \ -format %c histogram:info:- | \ sort -nr | \ sed -n '1s/[^#]*\([^ ]*\).*/\1/p'
Very beginner question, I'm sure, but when I execute this script it closes the terminal emulator immediately after running before I can see an output. Should I be executing some other way?
Offline
Run it from an actual terminal rather than clicking on it from a GUI
Online
Run it from an actual terminal rather than clicking on it from a GUI
I was running it through kitty with exec getcol.sh (which I renamed it to). It kills the kitty instance upon resolution.
Offline
Don't use exec, it replaces the parent process (i.e. your shell) with the child process. Set the executable bit and just run it
chmod +x getcol.sh
./getcol.shLast edited by V1del (2019-12-25 23:04:25)
Online