UNPKG

fui-fancyui

Version:
12 lines (11 loc) 311 B
const e = (r, a, t) => { t /= 100; const c = a * Math.min(t, 1 - t) / 100, n = (s) => { const o = (s + r / 30) % 12, h = t - c * Math.max(Math.min(o - 3, 9 - o, 1), -1); return Math.round(255 * h).toString(16).padStart(2, "0"); }; return `#${n(0)}${n(8)}${n(4)}`; }; export { e as hslToHex };