fix brightness scale

This commit is contained in:
Johannes
2022-03-26 11:23:19 +01:00
committed by GitHub
parent 028ddb7896
commit 9c2d91e3d9

View File

@@ -29,7 +29,7 @@ def pos_to_color(x, y):
def rgb_brightness(rgb_color, brightness): def rgb_brightness(rgb_color, brightness):
# brightness values are in range 0-255 # brightness values are in range 0-255
# to make sure that the color is not completly lost we need to rescale this to 70-255 # to make sure that the color is not completly lost we need to rescale this to 70-255
brightness = int(scale(entity.attributes.brightness,(0,255),(70,255))) brightness = int(scale(brightness,(0,255),(70,255)))
red = rgb_color[0]/255*brightness red = rgb_color[0]/255*brightness
green = rgb_color[1]/255*brightness green = rgb_color[1]/255*brightness
blue = rgb_color[2]/255*brightness blue = rgb_color[2]/255*brightness