Schoening 4 Posted January 13, 2012 (edited) This is a Quick one! Lets say i want to make the PixelGetColor not to take a exact match. If i want it to take diffrent Shades of Blue for instance. Lets say Bluelight gets the Value 100 from PixelGetColor and BlueDark gets 200 I want to take in the whole spectrum of Blue IF Pixelsearch > 250 Just some very bad, halfhearted example code to make my point more obvious Is there a list of Color Codes somewhere? Or can some simple math figure it out how the Color Code gets its numbers? Or can i even Convert Html color code with the right formula? Edited January 13, 2012 by Schoening Share this post Link to post Share on other sites
Malkey 231 Posted January 14, 2012 This may give you a few ideas. There are other ways of getting the individual colour channel values from a RGB colour. expandcollapse popupOpt("MouseCoordMode", 1) ;1=absolute, 0=relative, 2=client HotKeySet("{ESC}", "Terminate") Local $exit = 1 While $exit Sleep(10) TtColXY() WEnd ; TtColXY() Tooltip shows colour, and cursor position relative to screen and window. Func TtColXY() $aPos = MouseGetPos() $sColor = "0x" & Hex(PixelGetColor($aPos[0], $aPos[1]), 6) $iPosX = ($aPos[0] - 100) * ($aPos[0] > @DesktopWidth * 0.90) + ($aPos[0] <= @DesktopWidth * 0.90) * ($aPos[0] + 3) $iPosY = ($aPos[1] - 30) * ($aPos[1] > @DesktopHeight * 0.96) + ($aPos[1] <= @DesktopHeight * 0.96) * ($aPos[1] + 3) $Red = Int("0x" & StringRegExpReplace($sColor, "(..)(..)(..)(..)", "\2")) $Green = Int("0x" & StringRegExpReplace($sColor, "(..)(..)(..)(..)", "\3")) $Blue = Int("0x" & StringRegExpReplace($sColor, "(..)(..)(..)(..)", "\4")) If $Blue > $Green And $Blue > $Red Then If $Blue > 200 Then $BShade = "Light" If $Blue <= 200 Then $BShade = "Dark" Else $BShade = "Nil" EndIf ToolTip("Color is: " & $sColor & @CRLF & _ " R:" & $Red & _ " G:" & $Green & _ " B:" & $Blue & @CRLF & _ "Shade of blue - " & $BShade) Return EndFunc ;==>TtColXY Func Terminate() $exit = 0 EndFunc ;==>Terminate Share this post Link to post Share on other sites
Schoening 4 Posted January 14, 2012 ty ill look into it Share this post Link to post Share on other sites