This module provides 1-dimensional colour maps with smooth (linear) colour blending between control points.
Takes a range and a value, and returns a value inside
the given range. If the value is already in the range,
it is unchanged. Otherwise it "wraps around". For
example, if the range is
(0, 1) then, in effect,
the fractional part of the value is returned.
Note that extremely narrow ranges may exhibit numerical instability.
Simple colour range
This is the basic colour map type. It consists of a list of control points, each one being a parameter value and the colour at that parameter value. The colour at other parameter values is linearly interpolated between the control points.
Parameter values outside the range (i.e., below the first point or above the last point) take the colour of the end control point. This means that in the degenerate case of a single control point, the colour is applied everywhere (and the parameter value is ignored).
A map with zero control points is not permitted.
Compute the value of a colour map at a particular parameter value.
Repeating colour range
This is a colour map with has optional repeating behaviour using
Notice that the parameter range that gets repeated need not cover
the entire range of the underlying