Skip to content

Instantly share code, notes, and snippets.

View Splines's full-sized avatar
🚲

Splines Splines

🚲
View GitHub Profile
@Splines
Splines / lighten_color.py
Last active February 24, 2022 00:43 — forked from ihincks/lighten_color.py
Function to lighten any color in matplotlib
def change_brightness(color, amount=1):
"""
Changes the brightness of the given color by multiplying luminosity
by the given amount.
Input can be a matplotlib color string, hex string, or RGB tuple.
The color gets brighter when amount > 1 and darker when amount < 1.
The resulting luminosity is restricted to [0,1].