Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keyboard Shortcut - Find out the Hex Color Code anywhere on Screen
If you are a web developer or a graphic designer, you probably have color related tasks. There are plenty of fancy GUI-tools to help you with that. But if you just need to quickly find out the hexadecimal color code (RGB) at any point on your screen, this small script will do the job. Simply move the mouse pointer to the desired location, and use the keyboard shortcut to run the script.

Need help creating a keyboard shortcut with ShortKeeper using the following AutoHotkey code? This 5-minute tutorial will help!
MouseGetPos, MouseX, MouseY
PixelGetColor, color, %MouseX%, %MouseY%, Slow|RGB
Clipboard := color
MsgBox % "The color at the current cursor position is " color "."

The color will be shown in a dialog box and placed in the clipboard.

At the end of line #2, RGB can be replaced with BGR to swap the red and blue components.

The color will be shown in hexadecimal format (e.g., 0xFFFFFF). If you would like to remove the “0x” prefix, add the following instruction between lines #1 and #2:
StringTrimLeft, color, color, 2
Enterpad: For those who need more than a few shortcuts.


Forum Jump:

Users browsing this thread: 1 Guest(s)