i_to_white

compas.utilities.i_to_white(i, normalize=False)[source]

Convert a number between 0.0 and 1.0 to a shade of white.

Deprecated since version 1.14: Use Color instead.

Parameters
  • i (float) – A number between 0.0 and 1.0.

  • normalize (bool, optional) – If True, normalize the resulting RGB values. Default is to return integer values ranging from 0 to 255.

Returns

tuple – The RGB values of the color corresponding to the provided number. If normalize is true, the RGB values are normalized to values between 0.0 and 1.0. If normalize is false, the RGB values are integers between 0 and 255.

Examples

>>> i_to_white(1.0)
(255, 255, 255)
>>> i_to_white(0.0)
(0, 0, 0)