Package Scientific :: Package Visualization :: Module Color :: Class SymmetricColorScale

[frames] | no frames]

# Class SymmetricColorScale

Mapping of a symmetric number interval to a color range

The colors are red for negative numbers and green for positive numbers, with a color intensity proportional to the absolute value of the argument. Zero is mapped to white.

Instance Methods

Color

__call__(self, value) Returns: the color corresponding to value |

__init__(self, max, n=20) |

Method Details

### __call__(self, value)
(Call operator)

Parameters:
  - `value` (`float`) - the value within the range for which the color is requested. If the value is outside of the specified range, the edge of the range is used instead.
Returns: Color
  the color corresponding to value

### __init__(self, max, n=20)
(Constructor)

Parameters:
  - `max` (`float`) - a positive number defining the range, which is from -max to +max.