make rgb.val_limit apply globally

This commit is contained in:
xs5871 2022-09-16 16:43:02 +00:00 committed by Kyle Brown
parent 44233bbb01
commit 85b5aba679

View File

@ -249,6 +249,9 @@ class RGB(Extension):
:param val:
:param index: Index of LED/Pixel
'''
val = clamp(val, 0, self.val_limit)
if self.rgbw:
self.set_rgb(hsv_to_rgbw(hue, sat, val), index)
else:
@ -261,6 +264,9 @@ class RGB(Extension):
:param sat:
:param val:
'''
val = clamp(val, 0, self.val_limit)
if self.rgbw:
self.set_rgb_fill(hsv_to_rgbw(hue, sat, val))
else: