MCPcopy Create free account
hub / github.com/pbakaus/impeccable / hue2rgb

Function hue2rgb

cli/engine/design-system.mjs:207–214  ·  view source on GitHub ↗
(p, q, t)

Source from the content-addressed store, hash-verified

205 const s = Math.max(0, Math.min(1, S));
206 const l = Math.max(0, Math.min(1, L));
207 const hue2rgb = (p, q, t) => {
208 if (t < 0) t += 1;
209 if (t > 1) t -= 1;
210 if (t < 1 / 6) return p + (q - p) * 6 * t;
211 if (t < 1 / 2) return q;
212 if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
213 return p;
214 };
215 const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
216 const p = 2 * l - q;
217 return {

Callers 1

hslToRgbFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected