CheckColor / WaitColor - Color names of HEX color
Posted: 26 Mar 2024, 09:10
Hi!
I want two functions() to handle colors.
Check Color() - Reads a color on one dot.
and
WaitColor() - Waits until a certain color occurs at the specified coordinate.
At the same time, I want to be able to name certain colors (estimated 10-20 pcs) in the call of the function().
eg. #FF0000 = Red and #800000 = DarkRed.
Another request could be that several HEX colors can be given the same name and so on.
Know there are many details I have skipped in this example.
the function Color := CheckColor(X, Y, WinName)
e.g.
The result can be Red or #7F0000 if the color is not specified in the function().
_____________________________________________________________________________
The other function ColorWait(PosX, PosY, WinName, Color, MaxTime) works in a similar way.
_____________________________________________________________________________
My questions .:
Do these functions() already exist?
ColorCheck() is quite similar to ColorWait()
Can the comparisons be made on another way?
I want two functions() to handle colors.
Check Color() - Reads a color on one dot.
and
WaitColor() - Waits until a certain color occurs at the specified coordinate.
At the same time, I want to be able to name certain colors (estimated 10-20 pcs) in the call of the function().
eg. #FF0000 = Red and #800000 = DarkRed.
Another request could be that several HEX colors can be given the same name and so on.
Know there are many details I have skipped in this example.
the function Color := CheckColor(X, Y, WinName)
e.g.
Code: Select all
Color := CheckColor("254", "628", "ahk_exe Test.exe)"
_____________________________________________________________________________
The other function ColorWait(PosX, PosY, WinName, Color, MaxTime) works in a similar way.
Code: Select all
ColorWait(157, 227, "ahk_pid " progPID, "LightGreen", 5)
My questions .:
Do these functions() already exist?
Code: Select all
ColorWait(posX, PosY, WinName, Color, MaxTime)
WaitColor := "WrongColor"
If Color := "White"
WaitColor := "0xFFFFFF"
if Color := "Black"
WaitColor := "0x000000"
....
If WaitColor = "WrongColor"
MsgBox "the color " Color "is not defined"
....
Wait
PixelGetColor ....
Can the comparisons be made on another way?