Skip to content

Instantly share code, notes, and snippets.

@Scrxtchy
Created January 17, 2016 07:26
Show Gist options
  • Save Scrxtchy/d0a77ef88e78ba0deadc to your computer and use it in GitHub Desktop.
Save Scrxtchy/d0a77ef88e78ba0deadc to your computer and use it in GitHub Desktop.
Inputs Hex values into windows colour picker
;It's pretty spaghetti
hex2r(CR)
{
H := InStr(CR, "0x") ? CR : (InStr(CR, "#") ? "0x" SubStr(CR, 2) : "0x" CR)
r:= (H & 0xFF0000) >> 16
return r
}
hex2g(CR)
{
H := InStr(CR, "0x") ? CR : (InStr(CR, "#") ? "0x" SubStr(CR, 2) : "0x" CR)
g:= (H & 0xFF00) >> 8
return g
}
hex2b(CR)
{
H := InStr(CR, "0x") ? CR : (InStr(CR, "#") ? "0x" SubStr(CR, 2) : "0x" CR)
b:= (H & 0xFF)
return b
}
;Change F22 to whatever
F22::
r:= hex2r(clipboard)
g:= hex2g(clipboard)
b:= hex2b(clipboard)
send, ^a%r%{TAB}%g%{TAB}%b%
Return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment