Here you can find the source of getRGB(Color color)
public static int getRGB(Color color)
//package com.java2s; //License from project: Open Source License import java.awt.Color; public class Main { public static int getRGB(Color color) { return getRGB(color.getRed(), color.getGreen(), color.getBlue()); }/*from www . ja v a 2 s. c o m*/ public static int getRGB(float r, float g, float b) { return getRGB((int) (r * 255), (int) (g * 255), (int) (b * 255)); } public static int getRGB(int r, int g, int b) { return (r & 0xFF) << 16 | (g & 0xFF) << 8 | (b & 0xFF); } }