← Back to team overview

sikuli-driver team mailing list archive

[Question #203302]: Comparing RGB Colours

 

New question #203302 on Sikuli:
https://answers.launchpad.net/sikuli/+question/203302

I'm trying to compare some pixels to a set colour to find the extents of some selected text. I'm using the code.

    PixColour = MyRobot.getPixelColor(c,y)
    pColour = PixColour.getRGB()
    print PixColour, hex(pColour), hex(colour)
    if pColour == colour:
        print c


Which is printing out

java.awt.Color[r=49,g=106,b=197] -0xce953b 0x316ac5

By my reckoning the RGB values should give a hex value of 0x316ac5 however they aren't they are give -0xce953b and hence my detection of the colour is failing.

Can anyone explain to me where I'm going wrong

Thanks

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.