com.orsoncharts.plot

## Interface ColorSource

- All Known Implementing Classes:
    StandardColorSource

      public interface ColorSource

  A color source for use by the `PiePlot3D` class. This is the interface through which the plot will obtain colors for each data item (segment) in the chart. A default implementation (`StandardColorSource`) is provided.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.awt.Color` | `getColor(java.lang.Comparable<?> key)` Returns the color for one data item in the chart.
    `void` | `setColor(java.lang.Comparable<?> key, java.awt.Color color)` Sets the color associated with the specified key.
    `void` | `style(java.awt.Color... colors)` Restyles the source using the specified colors.

- - ### Method Detail

    - #### getColor

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

      Returns the color for one data item in the chart. We return a `Color` rather than a paint, because some manipulations that require a `Color` instance are done for the shading during the 3D rendering.
      Parameters:
        `key` - the key (`null` not permitted).
      Returns:
        The color.

    - #### setColor

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

      Sets the color associated with the specified key. If the supplied color is `null`, this will have the effect of clearing any previous setting and reverting to the default color.
      Parameters:
        `key` - the key (`null` not permitted).
        `color` - the color (`null` permitted).

    - #### style

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

      Restyles the source using the specified colors. Refer to the implementing class to confirm the precise behaviour (typically all existing color settings are cleared and the specified colors are installed as the new defaults).
      Parameters:
        `colors` - the colors.
      Since:
        1.2