Here you can find the source of rgb(float rIn, float gIn, float bIn)
public static int rgb(float rIn, float gIn, float bIn)
//package com.java2s; //License from project: LGPL public class Main { /**/*from ww w. j a v a 2s. com*/ * Makes an integer color from the given red, green, and blue float values */ public static int rgb(float rIn, float gIn, float bIn) { return rgb(floor(rIn * 255.0F), floor(gIn * 255.0F), floor(bIn * 255.0F)); } /** * Makes a single int color with the given red, green, and blue values. */ public static int rgb(int rIn, int gIn, int bIn) { int lvt_3_1_ = (rIn << 8) + gIn; lvt_3_1_ = (lvt_3_1_ << 8) + bIn; return lvt_3_1_; } /** * Returns the greatest integer less than or equal to the float argument */ public static int floor(float value) { int i = (int) value; return value < (float) i ? i - 1 : i; } /** * Returns the greatest integer less than or equal to the double argument */ public static int floor(double value) { int i = (int) value; return value < (double) i ? i - 1 : i; } }