Jump to content

color codes


Recommended Posts


I am haveing trouble sometimes useing window spy to get my color codes.

When for eg. I have to find the color of something real fine and I'm in a program with its owne pointer instead of the standard mouse pointer it tends to always read the color of my pointer no matter where i point.

I have tried takeing screenshots and useing photoshop and others to zoom in to get the color but it seems that they alter the color somehow becuase what i get from them is never rite. I think its from the anti-aliasing they use when i zoom or something.

My question is though what standard does autoit use for the color codes?

I know it isn't hex colors like you use for html because its always numbers and its not rgb codes eg. rrrgggbbb as in photoshop. If anyone knows please reply because I would love to find a color chart to use to double check myself.

I am trying to get pixel colors for things the size of a period (.) and it would help to know if the color code i get is closer to it or its suroundings at a glimps.


Link to comment
Share on other sites

I posted this in response to a related query. It may be of help to you also because it specifically addresses the "cursor blocks the pixel" issue you mentioned.

Here's an example with AutoHotkey that I've used myself. It may be helpful to you if the game is full-screen and thus AutoIt3 Window Spy can't easily be used with it.

This can be translated to AutoIt3 if you wish.

clipboard = ; Empty the clipboard

#z::  ; Win-Z hotkey
MouseGetPos, X, Y
; Move the cursor out of the way so that it doesn't block the pixel we want.
; Move the mouse slowly so that the game can keep up with it.
; This is necessary on some games but perhaps not yours:
MouseMove, 0, 0, 3
PixelGetColor, color, %X%, %Y%
MouseMove, %X%, %Y%, 1; moving faster seems ok in this case
clipboard = %clipboard%`nX%X% Y%Y% Color = %color%

Now start the script and enter the game. Move the mouse over each pixel of interest and then press Win-Z to store the info about it. Exit the game and paste the info into a text editor so that you can try to make sense of it and automate the game using the following commands (or their AutoIt3 equivalents):


PixelGetColor, OutputVar, %XCoord%, %YCoord%
If ErrorLevel <> 0
     MsgBox, PixelGetColor failed.
PixelSearch, OutputVarX, OutputVarY, %LeftCoord%, %TopCoord%, %RightCoord%, %BottomCoord%, %ColorToSearchFor%
If ErrorLevel <> 0
     MsgBox, That color was not found within the specified region.

If you want AutoHotkey it's here.

Good luck.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...