add effect parameters

This commit is contained in:
2021-04-06 00:07:32 +02:00
parent 7556deede0
commit 8911be8350
2 changed files with 131 additions and 16 deletions

View File

@@ -54,3 +54,21 @@ def black(framecount, index, target):
target[1] = 0
target[2] = 0
def adjust_saturation(framecount, index, target, params):
factor = params['factor']
rgb = sRGBColor(target[0], target[1], target[2], True)
hsv = convert_color(rgb, HSVColor)
hsv.hsv_s = min(hsv.hsv_s*factor,1)
print(params)
print(hsv)
hsv_to_target(hsv, target)
def rgb(framecount, index, target, params):
r = params["red"]
g = params["green"]
b = params["blue"]
p_index = params["index"]
if index == p_index or p_index == -1:
target[0] = r
target[1] = g
target[2] = b