Module Scientific.Visualization.Color

This module provides color definitions that are used in the modules VRML, VRML2, and VMD.


Functions


Class Color: RGB Color specification

Constructor: Color(rgb), where rgb is a sequence of three numbers between zero and one, specifying the red, green, and blue intensities.

Color objects can be added and multiplied with scalars.


Class ColorScale: Mapping of a number interval to a color range

Constructor: ColorScale(range), where range can be a tuple of two numbers (the center of the interval and its width), or a single number specifying the widths for a default center of zero.

Evaluation: colorscale(number) returns the Color object corresponding to number. If number is outside the predefined interval, the closest extreme value of the interval is used.

The color scale is blue - green - yellow - orange - red.


Class SymmetricColorScale: Mapping of a symmetric number interval to a color range

Constructor: SymmetricColorScale(range), where range is a single number defining the interval, which is -|range| to range.

Evaluation: colorscale(number) returns the Color object corresponding to number. If number is outside the predefined interval, the closest extreme value of the interval is used.

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