javax.swing.plaf

Class ColorUIResource

public class ColorUIResource extends Color implements UIResource

A Color that is marked as UIResource, which indicates that the color has been installed by a pluggable LookAndFeel. Such colors are replaced when the LookAndFeel changes.

See Also:

Constructor Summary
ColorUIResource(int r, int g, int b)
Constructs a ColorUIResource using the specified red, green, and blue values, which must be given as integers in the range of 0-255.
ColorUIResource(int rgb)
Constructs a ColorUIResource using the specified RGB value.
ColorUIResource(float r, float g, float b)
Constructs a ColorUIResource using the specified red, green, and blue intensities, which must be given as floats in the range of 0-1.
ColorUIResource(Color c)
Constructs a ColorUIResource, using the intensities of another color.

Constructor Detail

ColorUIResource

public ColorUIResource(int r, int g, int b)
Constructs a ColorUIResource using the specified red, green, and blue values, which must be given as integers in the range of 0-255. The alpha channel value will default to 255, meaning that the color is fully opaque.

Parameters: r the red intensity, which must be in the range [0 .. 255]. g the green intensity, which must be in the range [0 .. 255]. b the blue intensity, which must be in the range [0 .. 255].

Throws: IllegalArgumentException if any of the values is outside the specified range.

ColorUIResource

public ColorUIResource(int rgb)
Constructs a ColorUIResource using the specified RGB value. The blue value is in bits 0-7, green in bits 8-15, and red in bits 16-23. The other bits are ignored. The alpha value is set to 255, meaning that the color is fully opaque.

Parameters: rgb the rgb value, as discussed above.

ColorUIResource

public ColorUIResource(float r, float g, float b)
Constructs a ColorUIResource using the specified red, green, and blue intensities, which must be given as floats in the range of 0-1. The alpha channel value will default to 1.0f, meaning that the color is fully opaque.

Parameters: r the red intensity, which must be in the range [0.0 .. 1.0]. g the green intensity, which must be in the range [0.0 .. 1.0]. b the blue intensity, which must be in the range [0.0 .. 1.0].

Throws: IllegalArgumentException if any of the values is outside the specified range.

ColorUIResource

public ColorUIResource(Color c)
Constructs a ColorUIResource, using the intensities of another color.

Parameters: c the color whose intensities will be considered when constructing this ColorUIResource (null not permitted).

Throws: NullPointerException if c is null.