Java Color.RGBtoHSB(int r, int g, int b, float[] hsbvals)
Syntax
Color.RGBtoHSB(int r, int g, int b, float[] hsbvals) has the following syntax.
public static float[] RGBtoHSB(int r, int g, int b, float[] hsbvals)
Example
In the following code shows how to use Color.RGBtoHSB(int r, int g, int b, float[] hsbvals) method.
import java.awt.Color;
import java.util.Arrays;
// w w w.j a v a 2 s .co m
public class Main {
public static void main() {
int red = 23;
int green = 66;
int blue = 99;
float[] hsb = Color.RGBtoHSB(red, green, blue, null);
System.out.println(Arrays.toString(hsb));
}
}
Home »
Java Tutorial »
java.awt »
Java Tutorial »
java.awt »