functionscalarToColor_validityRange
Map a scalar to a color using a color map. colorMap used between T_min and T_nominal. Reversed colorMap is used between T_nominal and T_max
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. ## Copyright © EDF 2002 - 2025 ## ThermoSysPro Version 4.2
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | T | Scalar value | |
| Real | T_nominal | Nominal value, if T<Tnominal is mapped with colorMap, T>T_nominal is mapped with reversed colorMap | |
| Real | T_min | T <= T_min is mapped to colorMap[1,:] | |
| Real | T_max | T >= T_max is mapped to colorMap[end,:] | |
| Real[:,3] | colorMap | Color map |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[3] | color | Color of scalar value T |