color, for example, has three different components, one each for red, green, and blue... 

Każdy jest innym i nikt sobą samym.

A grayscale color has only one component—it describes the brightness of the color on a scale from black to white. The ColorSpace class includes a method that tells how many color components are used: public int getNumComponents()
This method returns the number of color components used by this ColorSpace.
You can retrieve the components of a particular color using one of the following methods in the Color class:
public float[] getColorComponents(float[] compArray)
This method returns the components of this Color as an array of floats. The components returned are valid for the ColorSpace of this Color. If the supplied array is not null, it is filled with the color components and returned. If the array parameter is null, a new array will be created and filled with the color components. No alpha component is returned by this method.
public float[] getColorComponents(ColorSpace cspace, float[] compArray)

page 148
Java 2D Graphics
This method returns the components of this Color in the supplied ColorSpace as an array of floats. Calling this method is equivalent to getting the color components using the previous method and converting them to the supplied ColorSpace (see the next section). If the supplied array is not null, it is filled with the color components and returned. No alpha component is returned by this method.
public float[] getRGBColorComponents(float[] compArray)
This method returns the components of this Color in the sRGB color space. It is almost the same as calling getColorComponents(ColorSpace.getInstance(ColorSpace.CS_sRGB), compArray).[1]
[1] Due to rounding errors in floating point arithmetic, the resulting color component arrays are slightly different.
8.3.3.4 Conversion methods
The most important methods in ColorSpace are the methods that convert to and from standard color spaces. In particular, ColorSpace can convert a color to and from CIEXYZ:
public abstract float[] toCIEXYZ(float[] colorvalue)
This method converts a color in this ColorSpace to CIEXYZ. The supplied array should contain as many components as are used in this color space. The returned array will always have three elements, corresponding to the X, Y, and Z in CIEXYZ.
public abstract float[] fromCIEXYZ(float[] colorvalue)
This method converts a color in CIEXYZ to this ColorSpace. The supplied array should contain three elements, corresponding to X, Y, and Z. The returned array will have as many components as are in this ColorSpace.
ColorSpace has a similar pair of functions that deal with the sRGB color space:
public abstract float[] toRGB(float colorvalue[])
public abstract float[] fromRGB(float rgbvalue[])
Remember, sRGB is not capable of representing all visible colors. Therefore, it is possible to lose color information if you use sRGB as a conversion color space. If you need to be sure you won't lose any information, use CIEXYZ instead.
8.3.3.5 And back to color, finally
By default, Colors are created in the sRGB color space. But the Color class provides one last constructor that allows you to use other color spaces:
public Color(ColorSpace cspace, float[] components, float alpha)
This constructor creates a new Color in the given color space, using the supplied
components and alpha value. The component array should have
cspace.getNumComponents() elements, and the alpha parameter should be between 0.0
and 1.0, inclusive.

page 149
Java 2D Graphics
Every color lives in a particular color space. It's easy to retrieve a Color's ColorSpace: public ColorSpace getColorSpace()
This method returns the ColorSpace in which this Color is defined.
If you want to convert colors from one color space to another, you won't usually have to convert in and out of CIEXYZ or sRGB yourself. Instead, you can use the getColorComponents() method in the Color class. The following method converts any color, in any color space, into grayscale: public static Color convertToGrayscale(Color color) {
ColorSpace graySpace = ColorSpace.getInstance(ColorSpace.CS_GRAY);
float[] gray = color.getColorComponents(graySpace, null);
return new Color(graySpace, gray, 1.0f);
}

8.4 Profiles