This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]. |