public final class HSSFPalette
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
HSSFPalette(PaletteRecord palette) |
Modifier and Type | Method and Description |
---|---|
HSSFColor |
addColor(byte red, byte green, byte blue)
Adds a new color into an empty color slot.
(将新颜色添加到空的颜色槽中。)
|
HSSFColor |
findColor(byte red, byte green, byte blue)
Finds the first occurrence of a given color
(查找给定颜色的第一次出现)
|
HSSFColor |
findSimilarColor(byte red, byte green, byte blue)
Finds the closest matching color in the custom palette.
(在自定义调色板中查找最接近的匹配颜色。)
|
HSSFColor |
findSimilarColor(int red, int green, int blue)
Finds the closest matching color in the custom palette.
(在自定义调色板中查找最接近的匹配颜色。)
|
HSSFColor |
getColor(int index)
Retrieves the color at a given index
(检索给定索引处的颜色)
|
HSSFColor |
getColor(short index)
Retrieves the color at a given index
(检索给定索引处的颜色)
|
void |
setColorAtIndex(short index, byte red, byte green, byte blue)
Sets the color at the given offset
(在给定偏移处设置颜色)
|
protected HSSFPalette(PaletteRecord palette)
public HSSFColor getColor(short index)
index
- the palette index, between 0x8 to 0x40 inclusive
(index - 调色板索引,介于 0x8 到 0x40 之间)
public HSSFColor getColor(int index)
index
- the palette index, between 0x8 to 0x40 inclusive
(index - 调色板索引,介于 0x8 到 0x40 之间)
public HSSFColor findColor(byte red, byte green, byte blue)
red
- the RGB red component, between 0 and 255 inclusive
(red - RGB 红色分量,介于 0 和 255(含)之间)
green
- the RGB green component, between 0 and 255 inclusive
(green - RGB 绿色分量,介于 0 和 255 之间(含))
blue
- the RGB blue component, between 0 and 255 inclusive
(blue - RGB 蓝色分量,介于 0 和 255 之间(含))
public HSSFColor findSimilarColor(byte red, byte green, byte blue)
red
- The red component of the color to match.
(red - 要匹配的颜色的红色分量。)
green
- The green component of the color to match.
(green - 要匹配的颜色的绿色分量。)
blue
- The blue component of the color to match.
(blue - 要匹配的颜色的蓝色分量。)
public HSSFColor findSimilarColor(int red, int green, int blue)
red
- The red component of the color to match.
(red - 要匹配的颜色的红色分量。)
green
- The green component of the color to match.
(green - 要匹配的颜色的绿色分量。)
blue
- The blue component of the color to match.
(blue - 要匹配的颜色的蓝色分量。)
public void setColorAtIndex(short index, byte red, byte green, byte blue)
index
- the palette index, between 0x8 to 0x40 inclusive
(index - 调色板索引,介于 0x8 到 0x40 之间)
red
- the RGB red component, between 0 and 255 inclusive
(red - RGB 红色分量,介于 0 和 255(含)之间)
green
- the RGB green component, between 0 and 255 inclusive
(green - RGB 绿色分量,介于 0 和 255 之间(含))
blue
- the RGB blue component, between 0 and 255 inclusive
(blue - RGB 蓝色分量,介于 0 和 255 之间(含))
public HSSFColor addColor(byte red, byte green, byte blue)
red
- The red component
(red - 红色组件)
green
- The green component
(green - 绿色组件)
blue
- The blue component
(blue - 蓝色分量)
java.lang.RuntimeException
- if there are more more free color indexes.
(java.lang.RuntimeException - 如果有更多的免费颜色索引。)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.