Java Example Program / Sample Source Code
import java.awt.Color;
public class ConvertRGBToHSB {
public static void main(String[] args) {
int red = 0x33;
int green = 0x66;
int blue = 0x99;
float[] hsb = Color.RGBtoHSB(red, green, blue, null);
float hue = hsb[0];
float saturation = hsb[1];
float brightness = hsb[2];
System.out.println(hue + " " + saturation + " " + brightness);
}
} |
|
|