Reference 〉 Class

Color(colorstr|tuple)

Stores a color for use in graphing and control panel display. The object can be passed in lieu of a color name or RGB tuple anywhere a color is required; that is, in model.addBreed(), Goods.add(), and TimeSeriesPlot.addSeries().

This is not intended to be a fully-fledged color interface, and only provides the necessary functionality for Helipad internals. For conversions into other colorspaces and other utilities, use the functions in matplotlib.colors or colorsys.

Initialization Parameters

  • color str|tuple, required

    A hex string, a color name string (see the Matplotlib documentation for valid values), or an RGB tuple with ranges from 0.0 to 1.0.

Methods

Click a method name for more detailed documentation.

  • blend( color )

    Creates a new color halfway between the existing color and another.

  • darken( )

    Creates a new color, slightly darker than the original. Used for generating hover colors.

  • lighten( factor )

    Creates a lighter secondary color from the existing color.

Object Properties

  • rgb list[float]

    A 3-item list of RGB values ranging from 0.0-1.0. Currently this is the only writable property.
    r, g, and b properties are also available individually.

  • hsv list[float]

    A 3-item list of HSV values ranging from 0.0-1.0. This property is not writable.
    h, s, and v properties are also available individually.

  • hex str

    A six-digit hex color string, prefixed with '#'.

Notes and Examples

  1. Contribute a Note

    Your email address will not be published. Required fields are marked *

    You may use limited HTML for formatting. Please embed blocks of code in <pre><code> </code></pre> tags.

History