简体   繁体   中英

RGB integer to Color object

I am drawing an integer from a Color using this code:

robot.getPixelColor(x, y).getRGB()

Now how do I go from an integer back to an RGB color? I've looked about and I havn't seen anything that does this...

Thanks!

Actually getPixelColor(x,y) returns a java.awt.Color .

Color color = robot.getPixelColor(x,y);
int rgb = color.getRGB();
Color color2 = new Color(rgb);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM