Color.Color

Color.Color

Class Overview | Class Members | This Package | All Packages

Syntax 1
public Color( int r, int g, int b )
Parameters
r
the red component.
g
the green component.
b
the blue component.
Description
Creates a color with the specified red, green, and blue components. The three arguments must each be in the range 0-255.

The actual color used in rendering depends on finding the best match given the color space available for a given output device.

See Also
getRed, getGreen, getBlue, getRGB



Syntax 2
public Color( int rgb )
Parameters
rgb
an integer giving the red, green, and blue components.
Description
Creates a color with the specified RGB value, where the red component is in bits 16-23 of the argument, the green component is in bits 8-15 of the argument, and the blue component is in bits 0-7. The value zero indicates no contribution from the primary color component.

The actual color used in rendering depends on finding the best match given the color space available for a given output device.

See Also
getRGBdefault, getRed, getGreen, getBlue, getRGB



Syntax 3
public Color( float r, float g, float b )
Parameters
r
the red component
g
the red component
b
the red component
Description
Creates a color with the specified red, green, and blue values, where each of the values is in the range 0.0-1.0. The value 0.0 indicates no contribution from the primary color component. The value 1.0 indicates the maximum intensity of the primary color component.

The actual color used in rendering depends on finding the best match given the color space available for a given output device.

See Also
getRed, getGreen, getBlue, getRGB