Package org.cytoscape.util.color
Interface Palette
-
public interface Palette
This interface provides a consistent way for various providers (ColorBrewer, ColourLovers, etc.) to provide color palettes to Cytoscape routines.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Color[]
getColors()
Return the palette as an array of colorsColor[]
getColors(int nColors)
Return the palette as an array of colors of the requested length.Object
getIdentifier()
Return the internal identifier of this palette.String
getName()
Return the name of this palette.default PaletteProvider
getPaletteProvider()
Return the PaletteProvider for this palette.PaletteType
getType()
This is the type of the palette, using the Cynthia Brewer's classification.boolean
isColorBlindSafe()
Return true if the palette is color blind safe.int
size()
Return the number of colors natively in the palette.String
toString()
Return the string representation of this palette (usually the name)
-
-
-
Method Detail
-
getName
String getName()
Return the name of this palette. This is intended to be the user-visible name, not the internal identifier.- Returns:
- user-visible name of this palette
-
getIdentifier
Object getIdentifier()
Return the internal identifier of this palette. This is the internal identifier of the palette which might be different for different providers. For example, BrewerPalettes use short names (e.g. RdBu), while ColourLovers uses an integer.- Returns:
- the internal identifier for this palette
-
getType
PaletteType getType()
This is the type of the palette, using the Cynthia Brewer's classification.- Returns:
- the palette type
-
size
int size()
Return the number of colors natively in the palette.- Returns:
- the number of colors in the palette
-
getColors
Color[] getColors()
Return the palette as an array of colors- Returns:
- the color array
-
getColors
Color[] getColors(int nColors)
Return the palette as an array of colors of the requested length. If the number of colors in the palette is less than the requested number, the colors will be interpolated.- Returns:
- the color array
-
isColorBlindSafe
boolean isColorBlindSafe()
Return true if the palette is color blind safe.- Returns:
- true if the palette is color blind safe
-
toString
String toString()
Return the string representation of this palette (usually the name)
-
getPaletteProvider
default PaletteProvider getPaletteProvider()
Return the PaletteProvider for this palette. Note that by default, this returns null so as not to break existing palette implementations.- Returns:
- the
PaletteProvider
for this palette
-
-