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 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)
        Overrides:
        toString in class Object
        Returns:
        the palette 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