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

    Modifier and Type
    Method
    Description
    Return the palette as an array of colors
    getColors(int nColors)
    Return the palette as an array of colors of the requested length.
    Return the internal identifier of this palette.
    Return the name of this palette.
    Return the PaletteProvider for this palette.
    This is the type of the palette, using the Cynthia Brewer's classification.
    boolean
    Return true if the palette is color blind safe.
    default boolean
    Return true if the palette is reversable.
    default boolean
    Return true if the palette is reversed.
    default void
    reverse(boolean reverse)
    Reverse the palette.
    int
    Return the number of colors natively in the palette.
    Return the string representation of this palette (usually the name)
  • Method Details

    • 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
    • isReversable

      default boolean isReversable()
      Return true if the palette is reversable.
      Returns:
      true if the palette is reversable
    • isReversed

      default boolean isReversed()
      Return true if the palette is reversed.
      Returns:
      true if the palette is reversed
    • reverse

      default void reverse(boolean reverse)
      Reverse the palette. If this palette is reversable, setting reverse to true will cause the colors to be delivered in reverse order.
      Parameters:
      reverse - if true, reverse the colors, if false don't reverse the colors
    • 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