MCPcopy
hub / github.com/btmills/geopattern / hue2rgb

Function hue2rgb

lib/color.js:82–89  ·  view source on GitHub ↗
(p, q, t)

Source from the content-addressed store, hash-verified

80function hsl2rgb(hsl) {
81
82 function hue2rgb(p, q, t) {
83 if (t < 0) t += 1;
84 if (t > 1) t -= 1;
85 if (t < 1 / 6) return p + (q - p) * 6 * t;
86 if (t < 1 / 2) return q;
87 if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
88 return p;
89 }
90
91 var h = hsl.h, s = hsl.s, l = hsl.l;
92 var r, g, b;

Callers 1

hsl2rgbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected