;*********** Use **************
; Press Esc to terminate script
; Press F8 to open a color dialog box and choose a color
; Or
; Press F9 to get the color under the mouse pointer
; Then press F7 to watch for color change
;
; by Valuater...... Enjoy!!!
;******************************
#include <GuiConstants.au3>
#include <Misc.au3>
; BE SURE TO CHECK THESE TWO ***************************************************
Opt("MouseCoordMode", 0) ;1=absolute, 0=relative, 2=client
Opt("PixelCoordMode", 0) ;1=absolute, 0=relative, 2=client
Global $var, $Color_win, $pos, $my_color, $check
HotKeySet("{ESC}", "Terminate")
HotKeySet("{F9}", "Get_Color")
HotKeySet("{F8}", "Color_Box")
HotKeySet("{F7}", "Check_Color")
ToolTip('Get Color - is Running (F7 - Check Color)(F8 - Color Box)(F9 - Get Color)',0,0)
While 1
Sleep(100)
WEnd
;;;;;;;;
Func Color_Box()
$var = _ChooseColor (2)
$pos = MouseGetPos()
Show_Color()
EndFunc
Func Terminate()
Exit 0
EndFunc
Func Get_Color()
$pos = MouseGetPos()
$Svar = PixelGetColor( $pos[0] , $pos[1])
$var = "0x" & Hex($Svar,6)
Show_Color()
EndFunc
Func Show_Color()
GUIDelete($Color_win)
ClipPut($var)
$my_color = $var
$Color_win = GUICreate("RGB Color = " & $var, 290, 150, -1, -1)
GUISetBkColor($var)
GUISetFont(9, 400, -1, "MS Sans Serif")
GUICtrlCreateLabel(" This Color has been Copied to the ClipBoard " & @CRLF & @CRLF & " Just Paste it wherever you would like"& @CRLF & @CRLF & @CRLF & " Mouse position X=" & $pos[0] & " Y=" & $pos[1] , 10, 10, 270, 100)
GUICtrlSetFont(-1, 9, 650)
If $var = 0x000000 Then GUICtrlSetColor( -1, 0xFFFFFF)
$OK_Btn = GUICtrlCreateButton("&OK", 100, 110, 80, 30)
GUISetState()
While 2
$msg1 = GUIGetMsg()
If $msg1 = $OK_Btn Or $msg1 = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
GUIDelete($Color_win)
EndFunc
Func Check_Color()
$check = NOT $Check
If $check Then ToolTip('Get Color - is Checking Color',0,0)
While $check
$var2 = PixelGetColor( $pos[0] , $pos[1])
If $my_color <> $var2 Then
MsgBox(262208, "Color Check", " the Color has changed ")
ExitLoop
EndIf
WEnd
ToolTip('Get Color - is Running',0,0)
EndFunc