public class ColorMap extends Object
| 构造器 | 说明 |
|---|---|
ColorMap() |
Constructor
|
ColorMap(int n) |
Construct
|
ColorMap(Color c) |
Constructor
|
ColorMap(List<Color> cs) |
Constructor
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
Color |
getColor(float idx) |
Get color by float index
|
Color |
getColor(int idx) |
Get color
|
int |
getColorCount() |
Get color count
|
List<Color> |
getColorList(int n) |
Get color list
|
List<Color> |
getColorList(int n,
int alpha) |
Get color list
|
Color[] |
getColors() |
Get colors
|
Color[] |
getColors(int n) |
Get colors
|
Color[] |
getColors_bak(int n) |
Get colors
|
String |
getName() |
Get name
|
void |
readFromFile(File file) |
Read colors from file
|
void |
readFromFile(InputStream is) |
Read from input stream
|
void |
readFromFile(String fileName) |
Read colors from file
|
void |
readFromFile(String fileName,
int alpha) |
Read colors from file
|
void |
reverse() |
Reverse colors
|
void |
setColor(int idx,
Color color) |
Set color
|
void |
setColors(Color[] value) |
Set colors
|
void |
setName(String value) |
Set name
|
public ColorMap()
public ColorMap(Color c)
c - Colorpublic ColorMap(int n)
n - Color numberpublic String getName()
public void setName(String value)
value - Namepublic Color[] getColors()
public void setColors(Color[] value)
value - Colorspublic Color getColor(int idx)
idx - Color indexpublic Color getColor(float idx)
idx - Float indexpublic void setColor(int idx,
Color color)
idx - Color indexcolor - The colorpublic int getColorCount()
public Color[] getColors(int n)
n - Color numberpublic Color[] getColors_bak(int n)
n - Color numberpublic List<Color> getColorList(int n)
n - Color numberpublic List<Color> getColorList(int n, int alpha)
n - Color numberalpha - Alphapublic void reverse()
public void readFromFile(InputStream is) throws IOException
is - Input stramIOExceptionpublic void readFromFile(String fileName) throws FileNotFoundException, IOException
fileName - The file nameFileNotFoundExceptionIOExceptionpublic void readFromFile(String fileName, int alpha) throws FileNotFoundException, IOException
fileName - The file namealpha - AlphaFileNotFoundExceptionIOExceptionpublic void readFromFile(File file) throws FileNotFoundException, IOException
file - The fileFileNotFoundExceptionIOExceptionCopyright © 2019. All rights reserved.