← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #680738]: switchApp()

 

Question #680738 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/680738

RaiMan proposed the following answer:
Please start a new question for a new topic.
New questions are seen by the community, whereas comments on questions are only seen by the creator, other subscribers and me.

pixelcolor:
if you want to work with screen colors, you need to know the structure of the RGB color scheme.

SikuliX has a function:

color = Location(x,y).getColor()

color now is a color object, that you can evaluate:
red = color.getRed()
green = color.getGreen()
blue = color.getBlue()

rgb = color.getRGB()


now you have the color components

waiting for color change:

oldColor = someLocation.getColor()
while True:
    newColor = someLocation.getColor()
    if oldCor.getRGB() == newColor.getRGB():
        wait(1) # wait 1 sec
        continue # and check again
    break # color has changed - end the loop

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.