Package com.helger.css.utils
Enum ECSSColor
- All Implemented Interfaces:
com.helger.commons.name.IHasName,ICSSNamedColor,Serializable,Comparable<ECSSColor>,java.lang.constant.Constable
CSS basic colors. Source: http://www.w3.org/TR/css3-color/ chapter 4.1 and
4.3
- Author:
- Philip Helger
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptiongetAsHSL()getAsHSLA(float fOpacity) getAsHSLAColorValue(float fOpacity) getAsRGB()getAsRGBA(float fOpacity) getAsRGBAColorValue(float fOpacity) intgetBlue()static ECSSColorintgetGreen()floatgetHue()floatgetName()intgetRed()floatstatic booleanisDefaultColorName(String sName) Check if the passed color name is a default color name.static ECSSColorReturns the enum constant of this type with the specified name.static ECSSColor[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
ALICEBLUE
-
ANTIQUEWHITE
-
AQUA
-
AQUAMARINE
-
AZURE
-
BEIGE
-
BISQUE
-
BLACK
-
BLANCHEDALMOND
-
BLUE
-
BLUEVIOLET
-
BROWN
-
BURLYWOOD
-
CADETBLUE
-
CHARTREUSE
-
CHOCOLATE
-
CORAL
-
CORNFLOWERBLUE
-
CORNSILK
-
CRIMSON
-
CYAN
-
DARKBLUE
-
DARKCYAN
-
DARKGOLDENROD
-
DARKGRAY
-
DARKGREEN
-
DARKGREY
-
DARKKHAKI
-
DARKMAGENTA
-
DARKOLIVEGREEN
-
DARKORANGE
-
DARKORCHID
-
DARKRED
-
DARKSALMON
-
DARKSEAGREEN
-
DARKSLATEBLUE
-
DARKSLATEGRAY
-
DARKSLATEGREY
-
DARKTURQUOISE
-
DARKVIOLET
-
DEEPPINK
-
DEEPSKYBLUE
-
DIMGRAY
-
DIMGREY
-
DODGERBLUE
-
FIREBRICK
-
FLORALWHITE
-
FORESTGREEN
-
FUCHSIA
-
GAINSBORO
-
GHOSTWHITE
-
GOLD
-
GOLDENROD
-
GRAY
-
GREEN
-
GREENYELLOW
-
GREY
-
HONEYDEW
-
HOTPINK
-
INDIANRED
-
INDIGO
-
IVORY
-
KHAKI
-
LAVENDER
-
LAVENDERBLUSH
-
LAWNGREEN
-
LEMONCHIFFON
-
LIGHTBLUE
-
LIGHTCORAL
-
LIGHTCYAN
-
LIGHTGOLDENRODYELLOW
-
LIGHTGRAY
-
LIGHTGREEN
-
LIGHTGREY
-
LIGHTPINK
-
LIGHTSALMON
-
LIGHTSEAGREEN
-
LIGHTSKYBLUE
-
LIGHTSLATEGRAY
-
LIGHTSLATEGREY
-
LIGHTSTEELBLUE
-
LIGHTYELLOW
-
LIME
-
LIMEGREEN
-
LINEN
-
MAGENTA
-
MAROON
-
MEDIUMAQUAMARINE
-
MEDIUMBLUE
-
MEDIUMORCHID
-
MEDIUMPURPLE
-
MEDIUMSEAGREEN
-
MEDIUMSLATEBLUE
-
MEDIUMSPRINGGREEN
-
MEDIUMTURQUOISE
-
MEDIUMVIOLETRED
-
MIDNIGHTBLUE
-
MINTCREAM
-
MISTYROSE
-
MOCCASIN
-
NAVAJOWHITE
-
NAVY
-
OLDLACE
-
OLIVE
-
OLIVEDRAB
-
ORANGE
-
ORANGERED
-
ORCHID
-
PALEGOLDENROD
-
PALEGREEN
-
PALETURQUOISE
-
PALEVIOLETRED
-
PAPAYAWHIP
-
PEACHPUFF
-
PERU
-
PINK
-
PLUM
-
POWDERBLUE
-
PURPLE
-
RED
-
ROSYBROWN
-
ROYALBLUE
-
SADDLEBROWN
-
SALMON
-
SANDYBROWN
-
SEAGREEN
-
SEASHELL
-
SIENNA
-
SILVER
-
SKYBLUE
-
SLATEBLUE
-
SLATEGRAY
-
SLATEGREY
-
SNOW
-
SPRINGGREEN
-
STEELBLUE
-
TAN
-
TEAL
-
THISTLE
-
TOMATO
-
TURQUOISE
-
VIOLET
-
WHEAT
-
WHITE
-
WHITESMOKE
-
YELLOW
-
YELLOWGREEN
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getName
- Specified by:
getNamein interfacecom.helger.commons.name.IHasName- Returns:
- The name of the color as to be used in CSS. Neither
nullnor empty.
-
getRed
- Returns:
- The Red part of the RGB value. Is within the range 0-255.
-
getGreen
- Returns:
- The Green part of the RGB value. Is within the range 0-255.
-
getBlue
- Returns:
- The Blue part of the RGB value. Is within the range 0-255.
-
getHue
- Returns:
- The Hue part of the HSL value. Is within the range 0-359.
-
getSaturation
- Returns:
- The Saturation part of the HSL value. Is within the range 0-100.
-
getLightness
- Returns:
- The Lightness part of the HSL value. Is within the range 0-100.
-
getAsHexColorValue
- Returns:
- The CSS hex color representation of this color (e.g. #ff0000)
-
getAsRGBColorValue
- Returns:
- This color as an CSS RGB color value.
-
getAsRGB
- Returns:
- This color as an CSS RGB color object.
-
getAsRGBAColorValue
- Parameters:
fOpacity- The opacity to be used. Is scaled to 0-1.- Returns:
- This color as an CSS RGBA color value.
-
getAsRGBA
- Parameters:
fOpacity- The opacity to be used. Is scaled to 0-1.- Returns:
- This color as an CSS RGBA color object.
-
getAsHSLColorValue
- Returns:
- This color as an CSS HSL color value.
-
getAsHSL
- Returns:
- This color as an CSS HSL color object.
-
getAsHSLAColorValue
- Parameters:
fOpacity- The opacity to be used. Is scaled to 0-1.- Returns:
- This color as an CSS HSLA color value.
-
getAsHSLA
- Parameters:
fOpacity- The opacity to be used. Is scaled to 0-1.- Returns:
- This color as an CSS HSL color object.
-
getFromNameCaseInsensitiveOrNull
-
isDefaultColorName
Check if the passed color name is a default color name.- Parameters:
sName- The color name to check.- Returns:
trueif the passed color name is a default color name,falseif not.
-