Enum Class ExcelColorPalette
- All Implemented Interfaces:
Serializable,Comparable<ExcelColorPalette>,Constable
Excel-compatible indexed color palette (BIFF legacy)
-
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 TypeMethodDescriptionstatic ExcelColorPaletteFinds a palette color by its hexadecimal representation.static ExcelColorPalettefromIndex(int index) Finds a palette color by its index.static ExcelColorPalettefromRgb(int red, int green, int blue) Finds a palette color by its RGB components.getBlue()Gets the blue component of the color.Gets the description of the color.Gets the ExcelColor instance for this palette color.getGreen()Gets the green component of the color.getHex()Gets the color as a hexadecimal string (e.g., "#RRGGBB").getIndex()Gets the Excel color palette index.getRed()Gets the red component of the color.getRgb()Gets the RGB value as a single integer (0xRRGGBB format).static ExcelColorPaletteReturns the enum constant of this class with the specified name.static ExcelColorPalette[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BLACK1
-
WHITE1
-
RED1
-
BRIGHT_GREEN1
-
BLUE1
-
YELLOW1
-
PINK1
-
TURQUOISE1
-
BLACK
-
WHITE
-
RED
-
BRIGHT_GREEN
-
BLUE
-
YELLOW
-
PINK
-
TURQUOISE
-
DARK_RED
-
GREEN
-
DARK_BLUE
-
DARK_YELLOW
-
VIOLET
-
TEAL
-
GREY_25_PERCENT
-
GREY_50_PERCENT
-
CORNFLOWER_BLUE
-
MAROON
-
LEMON_CHIFFON
-
LIGHT_TURQUOISE1
-
ORCHID
-
CORAL
-
ROYAL_BLUE
-
LIGHT_CORNFLOWER_BLUE
-
SKY_BLUE
-
LIGHT_TURQUOISE
-
LIGHT_GREEN
-
LIGHT_YELLOW
-
PALE_BLUE
-
ROSE
-
LAVENDER
-
TAN
-
LIGHT_BLUE
-
AQUA
-
LIME
-
GOLD
-
LIGHT_ORANGE
-
ORANGE
-
BLUE_GREY
-
GREY_40_PERCENT
-
DARK_TEAL
-
SEA_GREEN
-
DARK_GREEN
-
OLIVE_GREEN
-
BROWN
-
PLUM
-
INDIGO
-
GREY_80_PERCENT
-
AUTOMATIC
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
getIndex
Gets the Excel color palette index.- Returns:
- the palette index
-
getRed
Gets the red component of the color.- Returns:
- the red component (0-255), or null for AUTOMATIC
-
getGreen
Gets the green component of the color.- Returns:
- the green component (0-255), or null for AUTOMATIC
-
getBlue
Gets the blue component of the color.- Returns:
- the blue component (0-255), or null for AUTOMATIC
-
getDescription
Gets the description of the color.- Returns:
- the color description
-
getRgb
Gets the RGB value as a single integer (0xRRGGBB format).- Returns:
- the RGB value, or null for AUTOMATIC
-
getHex
Gets the color as a hexadecimal string (e.g., "#RRGGBB").- Returns:
- the hex color string, or null for AUTOMATIC
-
getExcelColor
Gets the ExcelColor instance for this palette color.- Returns:
- the ExcelColor instance
-
fromIndex
Finds a palette color by its index.- Parameters:
index- the palette index to search for- Returns:
- the matching ExcelColorPalette, or null if not found
-
fromRgb
Finds a palette color by its RGB components.- Parameters:
red- the red component (0-255)green- the green component (0-255)blue- the blue component (0-255)- Returns:
- the matching ExcelColorPalette, or null if not found
-
fromHex
Finds a palette color by its hexadecimal representation.- Parameters:
hex- the hex color string (e.g., "#RRGGBB" or "RRGGBB")- Returns:
- the matching ExcelColorPalette, or null if not found or invalid format
-