iwfm.plot.data_to_color

iwfm.plot.data_to_color(value, min_value, max_value, colormap='rainbow')[source]

Map a data value to a corresponding RGB color.

Parameters:
  • value (float) – The data value to be mapped to a color.

  • min_value (float) – The minimum value of the data range.

  • max_value (float) – The maximum value of the data range.

  • colormap (str) – The name of the colormap to use. The default is ‘rainbow’.

Returns:

rgb_color – A tuple containing three integers (R, G, B) representing the RGB color components of the mapped color. Each component ranges from 0 to 255.

Return type:

tuple