Package elki.visualization.colors
Class ListBasedColorLibrary
- java.lang.Object
-
- elki.visualization.colors.ListBasedColorLibrary
-
- All Implemented Interfaces:
ColorLibrary
public class ListBasedColorLibrary extends java.lang.Object implements ColorLibrary
Color library using the color names from a list.- Since:
- 0.3
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String[]
colors
Array of color names.private java.lang.String
name
Color scheme name-
Fields inherited from interface elki.visualization.colors.ColorLibrary
COLOR_AXIS_LABEL, COLOR_AXIS_LINE, COLOR_AXIS_MINOR_TICK, COLOR_AXIS_TICK, COLOR_KEY_BACKGROUND, COLOR_KEY_LABEL, COLOR_LINE_COLORS, COLOR_PAGE_BACKGROUND, COLOR_PLOT_BACKGROUND
-
-
Constructor Summary
Constructors Constructor Description ListBasedColorLibrary(java.lang.String[] colors, java.lang.String name)
Constructor without a properties file name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getColor(int index)
Return the i'th color.protected java.lang.String
getName()
Get the color scheme name.int
getNumberOfNativeColors()
Return the number of native colors available.
-
-
-
Method Detail
-
getColor
public java.lang.String getColor(int index)
Description copied from interface:ColorLibrary
Return the i'th color.- Specified by:
getColor
in interfaceColorLibrary
- Parameters:
index
- color index- Returns:
- color in hexadecimal notation (#aabbcc) or color name ("red") as valid in CSS and SVG.
-
getNumberOfNativeColors
public int getNumberOfNativeColors()
Description copied from interface:ColorLibrary
Return the number of native colors available. These are guaranteed to be unique.- Specified by:
getNumberOfNativeColors
in interfaceColorLibrary
- Returns:
- number of native colors
-
getName
protected java.lang.String getName()
Get the color scheme name.- Returns:
- the name
-
-