This script shows the color of the pixel under your mouse point and displays a copy-able Autohotkey script with the color code. Shared 11-9-2019. Great stuff.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
;Written By Joseph#0501 #SingleInstance Force CoordMode Mouse CoordMode Pixel Menu Tray, Icon, pifmgr.DLL, 17 Gui, Font, s8, Verdana Gui, +AlwaysOnTop +hwndGUIHwnd Gui, Add, Progress, Section w50 h50 BackgroundBlack cWhite hwndProgress, 100 Gui, Add, Button, gCopy wp, Copy Code Gui, Add, Edit, h91 ys w500 hwndMyEdit Gui, Add, Text, xm, Hold CTRL to pause color detection Gui, Show,, Color Spy SetTimer, GetColor, 50, ON Return GetColor: MouseGetPos, MouseX, MouseY, MouseWin If GetKeyState("CTRL", "P") OR (MouseWin = GUIHwnd) Return PixelGetColor, Color, % MouseX, % MouseY, RGB GuiControl, % "+c" SubStr(Color, 3) , % Progress UpdateEdit(MouseX, MouseY, Color, MyEdit) Return Copy: GuiControlGet, Text,, % MyEdit Clipboard := Text Return GuiClose: GuiEscape: ExitApp Return UpdateEdit(x, y, color, editHWND){ Contents= (Ltrim CoordMode Pixel Loop { PixelGetColor, Color, %x%, %y%, RGB }Until (Color = %Color%) ) GuiControl,, % editHWND, % Contents } |