correctly calculate delta hue

This commit is contained in:
2021-04-09 15:36:07 +02:00
parent 71c112ead6
commit c8b14aa7ac

View File

@@ -62,7 +62,8 @@ def adjust_hsv(framecount, index, target, params):
delta_v = params['delta_v']
rgb = sRGBColor(target[0], target[1], target[2], True)
hsv = convert_color(rgb, HSVColor)
hsv.hsv_h = min(hsv.hsv_h+delta_h, 360)
new_hue = math.fmod(hsv.hsv_h+delta_h, 360)
hsv.hsv_h = new_hue if new_hue >= 0 else 360+new_hue
hsv.hsv_s = min(hsv.hsv_s*factor_s+delta_s,1)
hsv.hsv_v = min(hsv.hsv_v*factor_v+delta_v,1)
hsv_to_target(hsv, target)