javax.swing.plaf
public class ColorUIResource extends Color implements UIResource
UIResource
, which indicates that
the color has been installed by a pluggable LookAndFeel. Such colors
are replaced when the LookAndFeel changes.Color
,
Serialized Formblack, 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
BITMASK, OPAQUE, TRANSLUCENT
Constructor and Description |
---|
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. |
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
public ColorUIResource(int r, int g, int b)
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.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].IllegalArgumentException
- if any of the values is outside the
specified range.public ColorUIResource(int rgb)
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.rgb
- the rgb value, as discussed above.public ColorUIResource(float r, float g, float b)
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.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].IllegalArgumentException
- if any of the values is outside the
specified range.public ColorUIResource(Color c)
ColorUIResource
, using the intensities
of another color.c
- the color whose intensities will be considered when
constructing this ColorUIResource
(null
not permitted).NullPointerException
- if c
is null
.