public class HTMLColor extends Color implements Comparable
Modifier and Type | Field and Description |
---|---|
static HTMLColor |
ALICE_BLUE
(240, 248, 255)
|
static HTMLColor |
ANTIQUE_WHITE
(250, 235, 215)
|
static HTMLColor |
AQUA
(0, 255, 255)
|
static HTMLColor |
AQUAMARINE
(127, 255, 212)
|
static HTMLColor |
AZURE
(240, 255, 255)
|
static HTMLColor |
BEIGE
(245, 245, 220)
|
static HTMLColor |
BISQUE
(255, 228, 196)
|
static HTMLColor |
BLACK
( 0, 0, 0)
|
static HTMLColor |
BLANCHED_ALMOND
(255, 235, 205)
|
static HTMLColor |
BLUE
( 0, 0, 255)
|
static HTMLColor |
BLUE_VIOLET
(138, 43, 226)
|
static HTMLColor |
BROWN
(165, 42, 42)
|
static HTMLColor |
BURLYWOOD
(222, 184, 135)
|
static HTMLColor |
CADET_BLUE
( 95, 158, 160)
|
static HTMLColor |
CHARTREUSE
(127, 255, 0)
|
static HTMLColor |
CHOCOLATE
(210, 105, 30)
|
static HTMLColor |
CORAL
(255, 127, 80)
|
static HTMLColor |
CORNFLOWER_BLUE
(100, 149, 237)
|
static HTMLColor |
CORNSILK
(255, 248, 220)
|
static HTMLColor |
CYAN
( 0, 255, 255)
|
static HTMLColor |
DARK_BLUE
( 0, 0, 139)
|
static HTMLColor |
DARK_CYAN
( 0, 139, 139)
|
static HTMLColor |
DARK_GOLDENROD
(184, 134, 11)
|
static HTMLColor |
DARK_GREEN
( 0, 100, 0)
|
static HTMLColor |
DARK_KHAKI
(189, 183, 107)
|
static HTMLColor |
DARK_MAGENTA
(139, 0, 139)
|
static HTMLColor |
DARK_OLIVE_GREEN
( 85, 107, 47)
|
static HTMLColor |
DARK_ORANGE
(255, 140, 0)
|
static HTMLColor |
DARK_ORCHID
(153, 50, 204)
|
static HTMLColor |
DARK_RED
(139, 0, 0)
|
static HTMLColor |
DARK_SALMON
(233, 150, 122)
|
static HTMLColor |
DARK_SEA_GREEN
(143, 188, 143)
|
static HTMLColor |
DARK_SLATE_BLUE
( 72, 61, 139)
|
static HTMLColor |
DARK_SLATE_GRAY
( 47, 79, 79)
|
static HTMLColor |
DARK_TURQUOISE
( 0, 206, 209)
|
static HTMLColor |
DARK_VIOLET
(148, 0, 211)
|
static HTMLColor |
DEEP_PINK
(255, 20, 147)
|
static HTMLColor |
DEEP_SKY_BLUE
( 0, 191, 255)
|
static HTMLColor |
DIM_GRAY
(105, 105, 105)
|
static HTMLColor |
DODGER_BLUE
( 30, 144, 255)
|
static HTMLColor |
FIREBRICK
(178, 34, 34)
|
static HTMLColor |
FLORAL_WHITE
(255, 250, 240)
|
static HTMLColor |
FOREST_GREEN
( 34, 139, 34)
|
static HTMLColor |
FUCHSIA
(255, 0, 255)
|
static HTMLColor |
GAINSBORO
(220, 220, 220)
|
static HTMLColor |
GHOST_WHITE
(248, 248, 255)
|
static HTMLColor |
GOLD
(255, 215, 0)
|
static HTMLColor |
GOLDENROD
(218, 165, 32)
|
static HTMLColor |
GREEN
( 0, 255, 0)
|
static HTMLColor |
GREEN_YELLOW
(173, 255, 47)
|
static HTMLColor |
GREY
(190, 190, 190)
|
static HTMLColor |
HONEYDEW
(240, 255, 240)
|
static HTMLColor |
HOT_PINK
(255, 105, 180)
|
static HTMLColor |
INDIAN_RED
(205, 92, 92)
|
static HTMLColor |
IVORY
(255, 255, 240)
|
static HTMLColor |
LAVENDER
(230, 230, 250)
|
static HTMLColor |
LAVENDER_BLUSH
(255, 240, 245)
|
static HTMLColor |
LAWN_GREEN
(124, 252, 0)
|
static HTMLColor |
LEMON_CHIFFON
(255, 250, 205)
|
static HTMLColor |
LIGHT_BLUE
(173, 216, 230)
|
static HTMLColor |
LIGHT_CORAL
(240, 128, 128)
|
static HTMLColor |
LIGHT_CYAN
(224, 255, 255)
|
static HTMLColor |
LIGHT_GOLDENROD
(238, 221, 130)
|
static HTMLColor |
LIGHT_GRAY
(211, 211, 211)
|
static HTMLColor |
LIGHT_GREEN
(144, 238, 144)
|
static HTMLColor |
LIGHT_PINK
(255, 182, 193)
|
static HTMLColor |
LIGHT_SALMON
(255, 160, 122)
|
static HTMLColor |
LIGHT_SEA_GREEN
( 32, 178, 170)
|
static HTMLColor |
LIGHT_SKY_BLUE
(135, 206, 250)
|
static HTMLColor |
LIGHT_SLATE_BLUE
(132, 112, 255)
|
static HTMLColor |
LIGHT_SLATE_GRAY
(119, 136, 153)
|
static HTMLColor |
LIGHT_STEEL_BLUE
(176, 196, 222)
|
static HTMLColor |
LIGHT_YELLOW
(255, 255, 224)
|
static HTMLColor |
LIME_GREEN
( 50, 205, 50)
|
static HTMLColor |
LINEN
(250, 240, 230)
|
static HTMLColor |
LT_GOLDENROD_YELLOW
(250, 250, 210)
|
static HTMLColor |
MAGENTA
(255, 0, 255)
|
static HTMLColor |
MAROON
(176, 48, 96)
|
static HTMLColor |
MED_SPRING_GREEN
( 0, 250, 154)
|
static HTMLColor |
MEDIUM_AQUAMARINE
(102, 205, 170)
|
static HTMLColor |
MEDIUM_BLUE
( 0, 0, 205)
|
static HTMLColor |
MEDIUM_ORCHID
(186, 85, 211)
|
static HTMLColor |
MEDIUM_PURPLE
(147, 112, 219)
|
static HTMLColor |
MEDIUM_SEA_GREEN
( 60, 179, 113)
|
static HTMLColor |
MEDIUM_SLATE_BLUE
(123, 104, 238)
|
static HTMLColor |
MEDIUM_TURQUOISE
( 72, 209, 204)
|
static HTMLColor |
MEDIUM_VIOLET_RED
(199, 21, 133)
|
static HTMLColor |
MIDNIGHT_BLUE
( 25, 25, 112)
|
static HTMLColor |
MINT_CREAM
(245, 255, 250)
|
static HTMLColor |
MISTY_ROSE
(255, 228, 225)
|
static HTMLColor |
MOCCASIN
(255, 228, 181)
|
static HTMLColor |
NAVAJO_WHITE
(255, 222, 173)
|
static HTMLColor |
NAVY
( 0, 0, 125)
|
static HTMLColor |
OLD_LACE
(253, 245, 230)
|
static HTMLColor |
OLIVE_DRAB
(107, 142, 35)
|
static HTMLColor |
ORANGE
(255, 165, 0)
|
static HTMLColor |
ORANGE_RED
(255, 69, 0)
|
static HTMLColor |
ORCHID
(218, 112, 214)
|
static HTMLColor |
PALE_GOLDENROD
(238, 232, 170)
|
static HTMLColor |
PALE_GREEN
(152, 251, 152)
|
static HTMLColor |
PALE_TURQUOISE
(175, 238, 238)
|
static HTMLColor |
PALE_VIOLET_RED
(219, 112, 147)
|
static HTMLColor |
PAPAYA_WHIP
(255, 239, 213)
|
static HTMLColor |
PEACH_PUFF
(255, 218, 185)
|
static HTMLColor |
PERU
(205, 133, 63)
|
static HTMLColor |
PINK
(255, 192, 203)
|
static HTMLColor |
PLUM
(221, 160, 221)
|
static HTMLColor |
POWDER_BLUE
(176, 224, 230)
|
static HTMLColor |
PURPLE
(160, 32, 240)
|
static HTMLColor |
RED
(255, 0, 0)
|
static HTMLColor |
ROSY_BROWN
(188, 143, 143)
|
static HTMLColor |
ROYAL_BLUE
( 65, 105, 225)
|
static HTMLColor |
SADDLE_BROWN
(139, 69, 19)
|
static HTMLColor |
SALMON
(250, 128, 114)
|
static HTMLColor |
SANDY_BROWN
(244, 164, 96)
|
static HTMLColor |
SEA_GREEN
( 46, 139, 87)
|
static HTMLColor |
SEASHELL
(255, 245, 238)
|
static HTMLColor |
SIENNA
(160, 82, 45)
|
static HTMLColor |
SKY_BLUE
(135, 206, 235)
|
static HTMLColor |
SLATE_BLUE
(106, 90, 205)
|
static HTMLColor |
SLATE_GRAY
(112, 128, 144)
|
static HTMLColor |
SNOW
(255, 250, 250)
|
static HTMLColor |
SPRING_GREEN
( 0, 255, 127)
|
static HTMLColor |
STEEL_BLUE
( 70, 130, 180)
|
static HTMLColor |
TAN
(210, 180, 140)
|
static HTMLColor |
THISTLE
(216, 191, 216)
|
static HTMLColor |
TOMATO
(255, 99, 71)
|
static HTMLColor |
TURQUOISE
( 64, 224, 208)
|
static HTMLColor |
VIOLET
(238, 130, 238)
|
static HTMLColor |
VIOLET_RED
(208, 32, 144)
|
static HTMLColor |
WHEAT
(245, 222, 179)
|
static HTMLColor |
WHITE
(255, 255, 255)
|
static HTMLColor |
WHITE_SMOKE
(245, 245, 245)
|
static HTMLColor |
YELLOW
(255, 255, 0)
|
static HTMLColor |
YELLOW_GREEN
(154, 205, 50)
|
black, blue, cyan, DARK_GRAY, darkGray, gray, GRAY, green, lightGray, magenta, orange, pink, red, white, yellow
BITMASK, OPAQUE, TRANSLUCENT
Constructor and Description |
---|
HTMLColor(Color inColor) |
HTMLColor(Color inColor,
int inAlpha) |
HTMLColor(int inRed,
int inGreen,
int inBlue) |
HTMLColor(int inRed,
int inGreen,
int inBlue,
int inAlpha) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object inObj2) |
int |
getBrightness()
Returns the color's brightness.
|
static int |
getBrightness(Color inColor)
Returns the color's brightness.
|
HTMLColor |
getContrastingColor()
Returns BLACK or WHITE depending on which has the higher contrast.
|
static HTMLColor |
getContrastingColor(Color inColor)
Returns BLACK or WHITE depending on which has the higher contrast.
|
String |
name()
Returns the color's name if one is defined else null.
|
String |
toHex()
Returns the hexadecimal code for the color preceded by a '#'.
|
String |
toRGBA()
Returns the color as a string formatted like 'rgba(255, 0, 120, 0.5)'.
|
String |
toString()
Returns the hexadecimal code for the color preceded by a '#'.
|
static HTMLColor |
valueOf(Color inColor)
Turns a Color value into an HTMLColor object.
|
static HTMLColor |
valueOf(String inColorString)
Turns a string value like 'blue' or a hexadecimal value into an HTMLColor object.
|
static Collection<HTMLColor> |
values()
Returns 134 standard named HTML colors.
|
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
public static final HTMLColor GHOST_WHITE
public static final HTMLColor WHITE_SMOKE
public static final HTMLColor FLORAL_WHITE
public static final HTMLColor ANTIQUE_WHITE
public static final HTMLColor PAPAYA_WHIP
public static final HTMLColor BLANCHED_ALMOND
public static final HTMLColor PEACH_PUFF
public static final HTMLColor NAVAJO_WHITE
public static final HTMLColor LEMON_CHIFFON
public static final HTMLColor MINT_CREAM
public static final HTMLColor ALICE_BLUE
public static final HTMLColor LAVENDER_BLUSH
public static final HTMLColor MISTY_ROSE
public static final HTMLColor DARK_SLATE_GRAY
public static final HTMLColor SLATE_GRAY
public static final HTMLColor LIGHT_SLATE_GRAY
public static final HTMLColor LIGHT_GRAY
public static final HTMLColor MIDNIGHT_BLUE
public static final HTMLColor CORNFLOWER_BLUE
public static final HTMLColor DARK_SLATE_BLUE
public static final HTMLColor SLATE_BLUE
public static final HTMLColor MEDIUM_SLATE_BLUE
public static final HTMLColor LIGHT_SLATE_BLUE
public static final HTMLColor MEDIUM_BLUE
public static final HTMLColor ROYAL_BLUE
public static final HTMLColor DODGER_BLUE
public static final HTMLColor DEEP_SKY_BLUE
public static final HTMLColor LIGHT_SKY_BLUE
public static final HTMLColor STEEL_BLUE
public static final HTMLColor LIGHT_STEEL_BLUE
public static final HTMLColor LIGHT_BLUE
public static final HTMLColor POWDER_BLUE
public static final HTMLColor PALE_TURQUOISE
public static final HTMLColor DARK_TURQUOISE
public static final HTMLColor MEDIUM_TURQUOISE
public static final HTMLColor LIGHT_CYAN
public static final HTMLColor CADET_BLUE
public static final HTMLColor MEDIUM_AQUAMARINE
public static final HTMLColor AQUAMARINE
public static final HTMLColor DARK_GREEN
public static final HTMLColor DARK_OLIVE_GREEN
public static final HTMLColor DARK_SEA_GREEN
public static final HTMLColor MEDIUM_SEA_GREEN
public static final HTMLColor LIGHT_SEA_GREEN
public static final HTMLColor PALE_GREEN
public static final HTMLColor SPRING_GREEN
public static final HTMLColor LAWN_GREEN
public static final HTMLColor LIGHT_GREEN
public static final HTMLColor CHARTREUSE
public static final HTMLColor MED_SPRING_GREEN
public static final HTMLColor GREEN_YELLOW
public static final HTMLColor LIME_GREEN
public static final HTMLColor YELLOW_GREEN
public static final HTMLColor FOREST_GREEN
public static final HTMLColor OLIVE_DRAB
public static final HTMLColor DARK_KHAKI
public static final HTMLColor PALE_GOLDENROD
public static final HTMLColor LT_GOLDENROD_YELLOW
public static final HTMLColor LIGHT_YELLOW
public static final HTMLColor LIGHT_GOLDENROD
public static final HTMLColor DARK_GOLDENROD
public static final HTMLColor ROSY_BROWN
public static final HTMLColor INDIAN_RED
public static final HTMLColor SADDLE_BROWN
public static final HTMLColor SANDY_BROWN
public static final HTMLColor DARK_SALMON
public static final HTMLColor LIGHT_SALMON
public static final HTMLColor DARK_ORANGE
public static final HTMLColor LIGHT_CORAL
public static final HTMLColor ORANGE_RED
public static final HTMLColor LIGHT_PINK
public static final HTMLColor PALE_VIOLET_RED
public static final HTMLColor MEDIUM_VIOLET_RED
public static final HTMLColor VIOLET_RED
public static final HTMLColor DARK_MAGENTA
public static final HTMLColor MEDIUM_ORCHID
public static final HTMLColor DARK_ORCHID
public static final HTMLColor DARK_VIOLET
public static final HTMLColor BLUE_VIOLET
public static final HTMLColor MEDIUM_PURPLE
public HTMLColor(int inRed, int inGreen, int inBlue)
public HTMLColor(int inRed, int inGreen, int inBlue, int inAlpha)
public static Collection<HTMLColor> values()
public static HTMLColor valueOf(String inColorString)
inColorString
- color name or hex valuepublic static HTMLColor valueOf(Color inColor)
inColor
- input Color objectpublic String name()
public String toHex()
public String toRGBA()
public int getBrightness()
((Red value X 299) + (Green value X 587) + (Blue value X 114)) / 1000
public static int getBrightness(Color inColor)
((Red value X 299) + (Green value X 587) + (Blue value X 114)) / 1000
inColor
- for which to calculate the brightnesspublic HTMLColor getContrastingColor()
public static HTMLColor getContrastingColor(Color inColor)
inColor
- for which to calculate the best contrasting colorpublic int compareTo(Object inObj2)
compareTo
in interface Comparable