newton.utils.bourke_color_map#

newton.utils.bourke_color_map(low, high, v)[source]#

Map a scalar value to an RGB color using Bourke’s color ramp.

Apply smooth rainbow color mapping where the value is linearly interpolated across five color bands: blue → cyan → green → yellow → red. Values outside the [low, high] range are clamped.

Based on Paul Bourke’s colour ramping method: https://paulbourke.net/texture_colour/colourspace/

Parameters:
  • low (float) – Minimum value of the input range.

  • high (float) – Maximum value of the input range.

  • v (float) – The scalar value to map to a color.

Returns:

RGB color as a list of three floats in the range [0.0, 1.0].

Return type:

list[float]