.ThermoSysPro.Functions.Utilities.scalarToColor_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

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.

Interface

function scalarToColor_validityRange
  extends Modelica.Icons.Function;
  input Real T "Scalar value" annotation(
    Dialog);
  input Real T_nominal "Nominal value, if T<Tnominal is mapped with colorMap, T>T_nominal is mapped with reversed colorMap" annotation(
    Dialog);
  input Real T_min "T <= T_min is mapped to colorMap[1,:]" annotation(
    Dialog);
  input Real T_max "T >= T_max is mapped to colorMap[end,:]" annotation(
    Dialog);
  input Real colorMap[:, 3] "Color map" annotation(
    Dialog);
  output Real color[3] "Color of scalar value T";
end scalarToColor_validityRange;

Generated at 2025-10-08T18:21:08Z by OpenModelicaOpenModelica 1.25.4 using GenerateDoc.mos