MCPcopy Create free account
hub / github.com/jsfiddle/togetherjs / hue2rgb

Function hue2rgb

togetherjs/libs/tinycolor.js:280–287  ·  view source on GitHub ↗
(p, q, t)

Source from the content-addressed store, hash-verified

278 l = bound01(l, 100);
279
280 function hue2rgb(p, q, t) {
281 if(t < 0) t += 1;
282 if(t > 1) t -= 1;
283 if(t < 1/6) return p + (q - p) * 6 * t;
284 if(t < 1/2) return q;
285 if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
286 return p;
287 }
288
289 if(s === 0) {
290 r = g = b = l; // achromatic

Callers 1

hslToRgbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected