public class Gradient
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
mColorMapSize
总颜色大小
|
int[] |
mColors
颜色数据
|
float[] |
mStartPoints
渐变点,以百分比设置
|
Constructor and Description |
---|
Gradient(int[] colors,
float[] startPoints)
根据颜色值和渐变点创建默认大小的渐变颜色
|
Gradient(int[] colors,
float[] startPoints,
int colorMapSize)
根据颜色值和渐变点创建指定大小的渐变颜色
|
Modifier and Type | Method and Description |
---|---|
int[] |
generateColorMap(double opacity)
根据透明色生成颜色值
|
public final int mColorMapSize
public int[] mColors
public float[] mStartPoints
public Gradient(int[] colors, float[] startPoints)
colors
- 颜色值数组startPoints
- 渐变点,取值范围 (0,1]public Gradient(int[] colors, float[] startPoints, int colorMapSize)
colors
- 颜色值数组startPoints
- 渐变点,取值范围 (0,1]colorMapSize
- 颜色数量