javax.swing.plaf
Class ColorUIResource
java.lang.Object
java.awt.Color
javax.swing.plaf.ColorUIResource
- All Implemented Interfaces:
- Paint, Transparency, Serializable, UIResource
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:
Color
,
Serialized Form
Fields inherited from class java.awt.Color |
black, BLACK, blue, BLUE, cyan, CYAN, DARK_GRAY, darkGray, gray, GRAY, green, GREEN, LIGHT_GRAY, lightGray, magenta, MAGENTA, orange, ORANGE, pink, PINK, red, RED, white, WHITE, yellow, YELLOW |
Constructor Summary |
ColorUIResource(Color c)
Constructs a ColorUIResource , using the intensities
of another color. |
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(int rgb)
Constructs a ColorUIResource using the specified
RGB value. |
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. |
Methods inherited from class java.awt.Color |
brighter, createContext, darker, decode, equals, getAlpha, getBlue, getColor, getColor, getColor, getColorComponents, getColorComponents, getColorSpace, getComponents, getComponents, getGreen, getHSBColor, getRed, getRGB, getRGBColorComponents, getRGBComponents, getTransparency, hashCode, HSBtoRGB, RGBtoHSB, toString |
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
.