UNPKG

fui-fancyui

Version:
10 lines (9 loc) 305 B
import s from "color"; const t = 0, n = 359.9, h = (o, e) => { const u = (o - e.left) / e.width * (n - t); return Math.min(Math.max(u, t), n); }, i = (o) => o ? { x: (s(o).hsl().object().h - t) / (n - t) * 100, y: 0 } : { x: 0, y: 0 }; export { i as colorToPositionHue, h as positionToColorHue };