public final class ExcelColor extends Object
ExcelColorPalette,
ExcelCellStyle| Modifier | Constructor and Description |
|---|---|
protected |
ExcelColor(Integer excelColorPaletteIndex,
Integer red,
Integer green,
Integer blue)
Creates an ExcelColor with the specified palette index and RGB components.
|
|
ExcelColor(int red,
int green,
int blue)
Creates an ExcelColor from RGB components.
|
| Modifier and Type | Method and Description |
|---|---|
ExcelColor |
darken(double factor)
Darkens a color.
|
boolean |
equals(Object obj) |
static ExcelColor |
fromIndex(int index)
Creates an ExcelColor from an Excel color palette index.
|
static ExcelColor |
fromRgb(byte[] rgb)
Creates an ExcelColor from an RGB byte array.
|
Integer |
getBlue()
Gets the blue component of this color.
|
Integer |
getExcelColorPaletteIndex()
Gets the Excel color palette index if this color matches a palette color.
|
Integer |
getGreen()
Gets the green component of this color.
|
String |
getHex()
Gets the color as a hexadecimal string (e.g., "#RRGGBB").
|
Integer |
getRed()
Gets the red component of this color.
|
Integer |
getRgb()
Gets the RGB value as a single integer (0xRRGGBB format).
|
int |
hashCode() |
ExcelColor |
lighten(double factor)
Lightens a color.
|
String |
toString() |
protected ExcelColor(Integer excelColorPaletteIndex, Integer red, Integer green, Integer blue)
excelColorPaletteIndex - the Excel color palette index, may be nullred - the red component (0-255), may be nullgreen - the green component (0-255), may be nullblue - the blue component (0-255), may be nullpublic ExcelColor(int red,
int green,
int blue)
red - the red component (0-255)green - the green component (0-255)blue - the blue component (0-255)public static ExcelColor fromRgb(byte[] rgb)
rgb - a 3-byte array containing red, green, and blue components (0-255)DataException - if rgb is null or does not contain exactly 3 bytespublic static ExcelColor fromIndex(int index)
index - the Excel color palette indexpublic Integer getExcelColorPaletteIndex()
public Integer getRed()
public Integer getGreen()
public Integer getBlue()
public Integer getRgb()
public String getHex()
public ExcelColor darken(double factor)
factor - a value between 0.0 and 1.0public ExcelColor lighten(double factor)
factor - a value between 0.0 and 1.0Copyright (c) 2006-2026 North Concepts Inc. All Rights Reserved.