rstoolbox.utils.color_variant

rstoolbox.utils.color_variant(color, brightness_offset=1)

Make a color darker or lighter.

Shift a color towards more darker (negative brightness_offset) or more lighter (positive brightness_offset).

Parameters:
  • color (Union[str, tuple]) – Input color, as an RGB tuple or in hex code.
  • brightness_offset (int) – Level of offset from the initial color.
Returns:

str - Color in hex format.