Class 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 Detail

      • colors

        private java.lang.String[] colors
        Array of color names.
      • name

        private java.lang.String name
        Color scheme name
    • Constructor Detail

      • ListBasedColorLibrary

        public ListBasedColorLibrary​(java.lang.String[] colors,
                                     java.lang.String name)
        Constructor without a properties file name.
        Parameters:
        colors - Colors
        name - Library name
    • Method Detail

      • getColor

        public java.lang.String getColor​(int index)
        Description copied from interface: ColorLibrary
        Return the i'th color.
        Specified by:
        getColor in interface ColorLibrary
        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 interface ColorLibrary
        Returns:
        number of native colors
      • getName

        protected java.lang.String getName()
        Get the color scheme name.
        Returns:
        the name