Package io.keikai.axyra.sheets.style
Class Color
java.lang.Object
io.keikai.axyra.sheets.style.Color
A typed spreadsheet color: plain ARGB, a legacy indexed-palette reference, a
theme-palette reference with an optional tint, or the automatic
(window-text) color — mirroring OOXML's color forms (ECMA-376 §18.8.3
CT_Color). Construct with rgb(int, int, int), argb,
indexed(int), theme(int), or auto(); inspect with
isRgb(), isIndexed(), isTheme(),
isAuto() and the matching readers.
Crosses the JNI boundary as a structured JSON object
({"rgb":"#AARRGGBB"}, {"indexed":N},
{"theme":I,"tint":T}, or {"auto":true}).
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintalpha()intargb()The packed 0xAARRGGBB value of an RGB color.static Colorargb(int a, int r, int g, int b) Color from 8-bit a/r/g/b.static Colorauto()The automatic (window-text) color.intblue()booleanstatic ColorDecode the FFI JSON color form: a structured map ({"rgb": ...}/{"indexed": N}/{"theme": I, "tint": T}/{"auto": true}) or a legacy string.intgreen()inthashCode()static Colorindexed(int index) A legacy indexed-palette color (ECMA-376 §18.8.27; index 0-255).intThe palette index of an indexed color.booleanisAuto()Whether this is the automatic (window-text) color.booleanWhether this is a legacy indexed-palette color.booleanisRgb()Whether this is a plain ARGB color.booleanisTheme()Whether this is a theme-palette color.static Colorof(int argb) Color from a packed 0xAARRGGBB int.static ColorParse"#RRGGBB"/"#AARRGGBB"(plus the legacy engine tokens"auto","indexed:N","theme:I:TINT_FP"); returnsnullfor anything else.intred()static Colorrgb(int r, int g, int b) Opaque color from 8-bit r/g/b.static Colortheme(int themeIndex) A theme-palette color with no tint (theme slot 0-11).static Colortheme(int themeIndex, double tint) A theme-palette color:themeIndexis the theme slot (0-11: dark1, light1, dark2, light2, accent1-6, hyperlink, followedHyperlink) andtintlightens (positive) or darkens (negative) it, in[-1, 1](ECMA-376 §18.8.19).intThe theme slot (0-11) of a theme color.doubletint()The tint in[-1, 1]of a theme color.toHex()"#AARRGGBB"of an RGB color.The structured JSON value crossed to the engine.toString()
-
Field Details
-
BLACK
-
WHITE
-
RED
-
GREEN
-
BLUE
-
YELLOW
-
GRAY
-
-
Method Details
-
rgb
Opaque color from 8-bit r/g/b. -
argb
Color from 8-bit a/r/g/b. -
of
Color from a packed 0xAARRGGBB int. -
indexed
A legacy indexed-palette color (ECMA-376 §18.8.27; index 0-255). -
theme
A theme-palette color with no tint (theme slot 0-11). -
theme
A theme-palette color:themeIndexis the theme slot (0-11: dark1, light1, dark2, light2, accent1-6, hyperlink, followedHyperlink) andtintlightens (positive) or darkens (negative) it, in[-1, 1](ECMA-376 §18.8.19). -
auto
The automatic (window-text) color. -
parse
Parse"#RRGGBB"/"#AARRGGBB"(plus the legacy engine tokens"auto","indexed:N","theme:I:TINT_FP"); returnsnullfor anything else. -
fromJson
Decode the FFI JSON color form: a structured map ({"rgb": ...}/{"indexed": N}/{"theme": I, "tint": T}/{"auto": true}) or a legacy string. Returnsnullfor an unrecognized value. Not intended for application code — public only for the sibling DTO packages. -
toJsonValue
The structured JSON value crossed to the engine. Not intended for application code — public only for the sibling DTO packages. -
isRgb
public boolean isRgb()Whether this is a plain ARGB color. -
isIndexed
public boolean isIndexed()Whether this is a legacy indexed-palette color. -
isTheme
public boolean isTheme()Whether this is a theme-palette color. -
isAuto
public boolean isAuto()Whether this is the automatic (window-text) color. -
indexedValue
public int indexedValue()The palette index of an indexed color. -
themeIndex
public int themeIndex()The theme slot (0-11) of a theme color. -
tint
public double tint()The tint in[-1, 1]of a theme color. -
argb
public int argb()The packed 0xAARRGGBB value of an RGB color. -
alpha
public int alpha() -
red
public int red() -
green
public int green() -
blue
public int blue() -
toHex
"#AARRGGBB"of an RGB color. -
equals
-
hashCode
public int hashCode() -
toString
-