Color: RGBtoHSB(int r, int g, int b, float[] hsbvals)
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];
float saturation = hsb[1];
float brightness = hsb[2];
}
}
Related examples in the same category