Convert RGB color to HSB color in Java
Description
The following code shows how to convert RGB color to HSB color.
Example
//from ww w. ja v a 2s . c o m
import java.awt.Color;
public class Main {
public static void main() {
int red = 23;
int green = 66;
int blue = 99;
float[] hsb = Color.RGBtoHSB(red, green, blue, null);
float hue = hsb[0];
System.out.println(hue);
float saturation = hsb[1];
System.out.println(saturation);
float brightness = hsb[2];
System.out.println(brightness);
}
}