scalarToColor

Map a scalar to a color using a color map

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

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.

Syntax

color = scalarToColor(T, T_min, T_max, colorMap)

Inputs (4)

T

Type: Real

Description: Scalar value

T_min

Type: Real

Description: T <= T_min is mapped to colorMap[1,:]

T_max

Type: Real

Description: T >= T_max is mapped to colorMap[end,:]

colorMap

Type: Real[:,3]

Description: Color map

Outputs (1)

color

Type: Real[3]

Description: Color of scalar value T