Example usage for java.awt Color getColorComponents

List of usage examples for java.awt Color getColorComponents

Introduction

In this page you can find the example usage for java.awt Color getColorComponents.

Prototype

public float[] getColorComponents(ColorSpace cspace, float[] compArray) 

Source Link

Document

Returns a float array containing only the color components of the Color in the ColorSpace specified by the cspace parameter.

Usage

From source file:Main.java

public static void main(String[] args) {

    Color myColor = Color.RED;

    System.out.println(//from w  w  w.  j  a  v a 2 s .  c o m
            Arrays.toString(myColor.getColorComponents(ColorSpace.getInstance(ColorSpace.CS_CIEXYZ), null)));

}