(p, q, t)
| 988 | l = clamp(l); |
| 989 | const q = l < .5 ? l*(1+s) : l+s-l*s, p = 2*l-q, |
| 990 | f = (p, q, t)=> |
| 991 | (t = mod(t,1))*6 < 1 ? p+(q-p)*6*t : |
| 992 | t*2 < 1 ? q : |
| 993 | t*3 < 2 ? p+(q-p)*(4-t*6) : p; |
| 994 | this.r = f(p, q, h + 1/3); |
| 995 | this.g = f(p, q, h); |
| 996 | this.b = f(p, q, h - 1/3); |