functionscalarToColor

Map a scalar to a color using a color map

Extends from Modelica.Icons.Function (Icon for functions).

Information

Syntax

//Real T, T_min, T_max, colorMap[:,3];
Colors.scalarToColor(T, T_min, T_max, colorMap);

Description

This function returns an rgb color Real[3] that corresponds to the value of "T". The color is selected from the colorMap by interpolation so that "T_min" corresponds to "colorMap[1,:]" and "T_max" corresponds to "colorMap[end,:]".

See also

ColorMaps, colorMapToSvg, PipeWithScalarField.

Inputs

TypeNameDefaultDescription
RealTScalar value
RealT_minT <= T_min is mapped to colorMap[1,:]
RealT_maxT >= T_max is mapped to colorMap[end,:]
Real[:,3]colorMapColor map

Outputs

TypeNameDefaultDescription
Real[3]colorColor of scalar value T