MCPcopy
hub / github.com/sarcadass/granim.js / hue2rgb

Function hue2rgb

lib/convertColorToRgba.js:78–85  ·  view source on GitHub ↗
(p, q, t)

Source from the content-addressed store, hash-verified

76}
77
78function hue2rgb(p, q, t) {
79 if (t < 0) t += 1;
80 if (t > 1) t -= 1;
81 if (t < 1 / 6) return p + (q - p) * 6 * t;
82 if (t < 1 / 2) return q;
83 if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
84 return p;
85}
86
87function hslaToRgb(h, s, l, a) {
88 var r, g, b, q, p;

Callers 1

hslaToRgbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected