We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d661b2 commit 50bca22Copy full SHA for 50bca22
adafruit_led_animation/color.py
@@ -73,6 +73,8 @@ def calculate_intensity(color, intensity=1.0):
73
:param color: color value (tuple, list or int)
74
:return: color
75
"""
76
+ # Note: This code intentionally avoids list comprehensions and intermediate variables
77
+ # for an approximately 2x performance gain.
78
if isinstance(color, int):
79
return (
80
(int((color & 0xFF0000) * intensity) & 0xFF0000)
0 commit comments