File size: 633 Bytes
b094968
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from math import cos
from math import sin
from math import pi

def apply_scaling(alg:str, current_step:int, total_steps:int, bri:float, con:float, sat:float, r:float, g:float, b:float):
    ratio = float(current_step / total_steps)
    rad = ratio * pi / 2

    mod = 1.0

    match alg:
        case "Cos":
            mod = cos(rad)
        case "Sin":
            mod = sin(rad)
        case "1 - Cos":
            mod = (1 - cos(rad))
        case "1 - Sin":
            mod = (1 - sin(rad))

    return [
        bri * mod,
        con * mod,
        (sat - 1) * mod + 1,
        r * mod,
        g * mod,
        b * mod
    ]