public class HSSFExtendedColor extends ExtendedColor
Constructor and Description |
---|
HSSFExtendedColor(ExtendedColor color) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getARGB() |
protected ExtendedColor |
getExtendedColor() |
short |
getIndex() |
protected byte[] |
getIndexedRGB() |
byte[] |
getRGB() |
protected byte[] |
getStoredRBG() |
int |
getTheme() |
double |
getTint()
Specifies the tint value applied to the ctColor.
(指定应用于 ctColor 的色调值。)
|
boolean |
isAuto() |
boolean |
isIndexed() |
boolean |
isRGB() |
boolean |
isThemed() |
void |
setRGB(byte[] rgb)
Sets the Red Green Blue or Alpha Red Green Blue
(设置红绿蓝或阿尔法红绿蓝)
|
void |
setTint(double tint)
Specifies the tint value applied to the ctColor.
(指定应用于 ctColor 的色调值。)
|
getARGBHex, getRGBOrARGB, getRGBWithTint, setARGBHex, setColor
public HSSFExtendedColor(ExtendedColor color)
protected ExtendedColor getExtendedColor()
public boolean isAuto()
isAuto
in class
ExtendedColor
(类 ExtendedColor 中的 isAuto)
public boolean isIndexed()
isIndexed
in class
ExtendedColor
(类 ExtendedColor 中的 isIndexed)
public boolean isRGB()
isRGB
in class
ExtendedColor
(类 ExtendedColor 中的 isRGB)
public boolean isThemed()
isThemed
in class
ExtendedColor
(类 ExtendedColor 中的 isThemed)
public short getIndex()
getIndex
in class
ExtendedColor
(类 ExtendedColor 中的 getIndex)
ExtendedColor.isIndexed()
is true
(索引颜色索引值,如果 ExtendedColor.isIndexed() 为真)
public int getTheme()
getTheme
in class
ExtendedColor
(类 ExtendedColor 中的 getTheme)
ExtendedColor.isThemed()
is true
(主题颜色的索引,如果 ExtendedColor.isThemed() 为真)
public byte[] getRGB()
getRGB
in class
ExtendedColor
(类 ExtendedColor 中的 getRGB)
public byte[] getARGB()
getARGB
in class
ExtendedColor
(类 ExtendedColor 中的 getARGB)
protected byte[] getStoredRBG()
getStoredRBG
in class
ExtendedColor
(类 ExtendedColor 中的 getStoredRBG)
public void setRGB(byte[] rgb)
ExtendedColor
setRGB
in class
ExtendedColor
(类 ExtendedColor 中的 setRGB)
rgb
- bytes
(RGB - 字节)
public double getTint()
ExtendedColor
If tint is supplied, then it is applied to the RGB value of the ctColor to determine the final ctColor applied.
The tint value is stored as a double from -1.0 .. 1.0, where -1.0 means 100% darken and 1.0 means 100% lighten. Also, 0.0 means no change.
In loading the RGB value, it is converted to HLS where HLS values are (0..HLSMAX), where HLSMAX is currently 255.
Here are some examples of how to apply tint to ctColor:(指定应用于 ctColor 的色调值。如果提供了 tint,则将其应用于 ctColor 的 RGB 值以确定最终应用的 ctColor。色调值存储为从 -1.0 .. 1.0 开始的双精度值,其中 -1.0 表示 100% 变暗,1.0 表示 100% 变亮。此外,0.0 表示没有变化。在加载 RGB 值时,将其转换为 HLS,其中 HLS 值为 (0..HLSMAX),其中 HLSMAX 当前为 255。以下是一些如何将 tint 应用于 ctColor 的示例: If (tint < 0) Lum' = Lum * (1.0 + tint) 例如:Lum = 200;色调 = -0.5;变暗 50% Lum' = 200 * (0.5) => 100 例如:Lum = 200;色调 = -1.0;变暗 100%(变黑) Lum' = 200 * (1.0-1.0) => 0 If (tint > 0) Lum' = Lum * (1.0-tint) + (HLSMAX - HLSMAX * (1.0-tint)) 例如: 流明 = 100;色调 = 0.75;减轻 75% Lum' = 100 * (1-.75) + (HLSMAX - HLSMAX*(1-.75)) = 100 * .25 + (255 - 255 * .25) = 25 + (255 - 63) = 25 + 192 = 217 例如:流明 = 100;色调 = 1.0;变亮 100%(变白)Lum' = 100 * (1-1) + (HLSMAX - HLSMAX*(1-1)) = 100 * 0 + (255 - 255 * 0) = 0 + (255 - 0) = 255)If (tint < 0) Lum' = Lum * (1.0 + tint) For example: Lum = 200; tint = -0.5; Darken 50% Lum' = 200 * (0.5) => 100 For example: Lum = 200; tint = -1.0; Darken 100% (make black) Lum' = 200 * (1.0-1.0) => 0 If (tint > 0) Lum' = Lum * (1.0-tint) + (HLSMAX - HLSMAX * (1.0-tint)) For example: Lum = 100; tint = 0.75; Lighten 75% Lum' = 100 * (1-.75) + (HLSMAX - HLSMAX*(1-.75)) = 100 * .25 + (255 - 255 * .25) = 25 + (255 - 63) = 25 + 192 = 217 For example: Lum = 100; tint = 1.0; Lighten 100% (make white) Lum' = 100 * (1-1) + (HLSMAX - HLSMAX*(1-1)) = 100 * 0 + (255 - 255 * 0) = 0 + (255 - 0) = 255
getTint
in class
ExtendedColor
(类 ExtendedColor 中的 getTint)
public void setTint(double tint)
ExtendedColor
If tint is supplied, then it is applied to the RGB value of the ctColor to determine the final ctColor applied.
The tint value is stored as a double from -1.0 .. 1.0, where -1.0 means 100% darken and 1.0 means 100% lighten. Also, 0.0 means no change.
In loading the RGB value, it is converted to HLS where HLS values are (0..HLSMAX), where HLSMAX is currently 255.
Here are some examples of how to apply tint to ctColor:(指定应用于 ctColor 的色调值。如果提供了 tint,则将其应用于 ctColor 的 RGB 值以确定最终应用的 ctColor。色调值存储为从 -1.0 .. 1.0 开始的双精度值,其中 -1.0 表示 100% 变暗,1.0 表示 100% 变亮。此外,0.0 表示没有变化。在加载 RGB 值时,将其转换为 HLS,其中 HLS 值为 (0..HLSMAX),其中 HLSMAX 当前为 255。以下是一些如何将 tint 应用于 ctColor 的示例: If (tint < 0) Lum' = Lum * (1.0 + tint) 例如:Lum = 200;色调 = -0.5;变暗 50% Lum' = 200 * (0.5) => 100 例如:Lum = 200;色调 = -1.0;变暗 100%(变黑) Lum' = 200 * (1.0-1.0) => 0 If (tint > 0) Lum' = Lum * (1.0-tint) + (HLSMAX - HLSMAX * (1.0-tint)) 例如: 流明 = 100;色调 = 0.75;减轻 75% Lum' = 100 * (1-.75) + (HLSMAX - HLSMAX*(1-.75)) = 100 * .25 + (255 - 255 * .25) = 25 + (255 - 63) = 25 + 192 = 217 例如:流明 = 100;色调 = 1.0;变亮 100%(变白)Lum' = 100 * (1-1) + (HLSMAX - HLSMAX*(1-1)) = 100 * 0 + (255 - 255 * 0) = 0 + (255 - 0) = 255)If (tint < 0) Lum' = Lum * (1.0 + tint) For example: Lum = 200; tint = -0.5; Darken 50% Lum' = 200 * (0.5) => 100 For example: Lum = 200; tint = -1.0; Darken 100% (make black) Lum' = 200 * (1.0-1.0) => 0 If (tint > 0) Lum' = Lum * (1.0-tint) + (HLSMAX - HLSMAX * (1.0-tint)) For example: Lum = 100; tint = 0.75; Lighten 75% Lum' = 100 * (1-.75) + (HLSMAX - HLSMAX*(1-.75)) = 100 * .25 + (255 - 255 * .25) = 25 + (255 - 63) = 25 + 192 = 217 For example: Lum = 100; tint = 1.0; Lighten 100% (make white) Lum' = 100 * (1-1) + (HLSMAX - HLSMAX*(1-1)) = 100 * 0 + (255 - 255 * 0) = 0 + (255 - 0) = 255
setTint
in class
ExtendedColor
(类 ExtendedColor 中的 setTint)
tint
- the tint value
(tint - 色调值)
protected byte[] getIndexedRGB()
getIndexedRGB
in class
ExtendedColor
(类 ExtendedColor 中的 getIndexedRGB)
ExtendedColor.isIndexed()
== true, null if not indexed or index is invalid
(索引颜色 RGB 字节,如果 ExtendedColor.isIndexed() == true,如果没有索引或索引无效,则为 null)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.