Jump to content
Sign in to follow this  

How to convert Hex to RGB?

Recommended Posts


Hello, ;)

I have made a pixel search for a game, but the thing is that I want all types of Green colour to be searched by the pixelsearcher, ie: Red= < 30 , Green=255 , Blue= < 30. When I got the hex code: 0x0E4412 this is only one color but I want all of the Green.(as mentioned above). Here is the code with the HEX color:

$pos = PixelSearch(0,24,1280,800,0x0E4412,0)

Hope you guyz can solve my problem.

Pls Reply as soon as possible, I will be keenly waiting. :)



Share this post

Link to post
Share on other sites

well the fact that you are making this for a game, means that this topic will be locked soon.

change the shade-variation to a higher number, i would say 255 but i dont know if that will be too big if a shade difference

Share this post

Link to post
Share on other sites

download this image and view it so that it is full screen:

Posted Image

then run this code:

For $i = 0 to 100 Step 5
$result = PixelSearch(0, 429, @DesktopWidth, 625, 0xFB7A02, $i) ;the is searching for the orange on the very RIGHT of the image
MouseMove($result[0], $result[1])

you can see that the greater the shade-variant is the farther away from the bright orange the pixel search returns a value.


obviously, make sure you r only search the area where the image is or it wont show the example lol

Edited by Kidney

Share this post

Link to post
Share on other sites


Game automation is not supported here as you have already been told. Please read the Forum Rules before posting again. ;)


As you correctly pointed out, the OP's question was in breach of the Forum rules - next time do not offer any help if this is the case. If the OP is unintelligent enough to admit what they are doing is not permitted here, they do not deserve any help. :)

Thread locked.


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Share this post

Link to post
Share on other sites
This topic is now closed to further replies.
Sign in to follow this