Color.getRGBComponents(float[] compArray) has the following syntax.
public float[] getRGBComponents(float[] compArray)
In the following code shows how to use Color.getRGBComponents(float[] compArray) method.
// w w w .j ava2 s . c o m import java.awt.Color; import java.util.Arrays; public class Main { public static void main(String[] args) { Color myColor = Color.RED; System.out.println(Arrays.toString(myColor.getRGBComponents(null))); } }
The code above generates the following result.