Colors

Linear interpolation

SolverTraces.safe_lerpFunction
safe_lerp(a, b, t)

Safe implementation of linear interpolation (lerp) between a and b, where t is the linear parameter. If isnan(t), a is returned, and if t is infinite, a or b is returned, depending on the sign.

source
SolverTraces.sat_ilerpFunction
sat_ilerp(a, b, t)

Saturated linear interpolation in integer steps, clamped to the range 0:255 (the available colour space).

source

Color scales

SolverTraces.LinearColorantType
LinearColorant(a, b, colors)

Helper structure to linearly interpolate between the possible values in colors, where the scalar value a corresponds to the first value and b to the last. If colors is a tuple of two triples, a continuous interpolation between the endpoints will be the result, whereas if it is a vector of Crayons, nearest neighbour interpolation will be performed instead.

source
SolverTraces.red_green_scaleFunction
red_green_scale()

Return a red–green colour scale; on Windows (with only 16 colours available), this is simply red, yellow, green, on other systems, the end-points are returned instead, for use with sat_ilerp.

source