com.orsoncharts.plot

## Class StandardColorSource

- java.lang.Object
- - com.orsoncharts.plot.StandardColorSource

- All Implemented Interfaces:
    ColorSource, java.io.Serializable

      public final class StandardColorSource
      extends java.lang.Object
      implements ColorSource, java.io.Serializable

  A standard implementation of the `ColorSource` interface.
  NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StandardColorSource()` Creates a new instance with default colors.
    `StandardColorSource(java.awt.Color... colors)` Creates a new instance with the supplied sequence of colors.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)` Tests this paint source for equality with an arbitrary object.
    `java.awt.Color` | `getColor(java.lang.Comparable<?> key)` Returns the color associated with the specified key.
    `void` | `setColor(java.lang.Comparable<?> key, java.awt.Color color)` Sets the color for the specified key.
    `void` | `style(java.awt.Color... colors)` Clears existing color settings and sets the default colors to the supplied value.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StandardColorSource

          public StandardColorSource()

      Creates a new instance with default colors.

    - #### StandardColorSource

          public StandardColorSource(java.awt.Color... colors)

      Creates a new instance with the supplied sequence of colors. The supplied array must have at least one entry, and all entries must be non-`null`.
      Parameters:
        `colors` - the colors (`null` not permitted).

  - ### Method Detail

    - #### getColor

          public java.awt.Color getColor(java.lang.Comparable<?> key)

      Returns the color associated with the specified key.
      Specified by:
        `getColor` in interface `ColorSource`
      Parameters:
        `key` - the key (`null` not permitted).
      Returns:
        The color (never `null`).

    - #### setColor

          public void setColor(java.lang.Comparable<?> key,
                               java.awt.Color color)

      Sets the color for the specified key.
      Specified by:
        `setColor` in interface `ColorSource`
      Parameters:
        `key` - the key (`null` not permitted).
        `color` - the color (`null` permitted).

    - #### style

          public void style(java.awt.Color... colors)

      Clears existing color settings and sets the default colors to the supplied value. This method is used by the framework and is not normally called by client code.
      Specified by:
        `style` in interface `ColorSource`
      Parameters:
        `colors` - the colors (`null` not permitted).
      Since:
        1.2

    - #### equals

          public boolean equals(java.lang.Object obj)

      Tests this paint source for equality with an arbitrary object.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `obj` - the object (`null` permitted).
      Returns:
        A boolean.