Here you can find the source of color(float red, float green, float blue)
public static int color(float red, float green, float blue)
//package com.java2s; public class Main { /** Unlike new Color(r,g,b).getRGB(), 1-epsilon rounds to brightest. Truncates red, green, and blue into range 0 to 1 if needed. *///from www . j a v a2s . com public static int color(float red, float green, float blue) { return 0xff000000 | (Math.max(0, Math.min((int) (red * 0x100), 0xff)) << 16) | (Math.max(0, Math.min((int) (green * 0x100), 0xff)) << 8) | Math.max(0, Math.min((int) (blue * 0x100), 0xff)); } public static int color(float alpha, float red, float green, float blue) { return (Math.max(0, Math.min((int) (alpha * 0x100), 0xff)) << 24) | (Math.max(0, Math.min((int) (red * 0x100), 0xff)) << 16) | (Math.max(0, Math.min((int) (green * 0x100), 0xff)) << 8) | Math.max(0, Math.min((int) (blue * 0x100), 0xff)); } }