UNPKG

@macrostrat/column-components

Version:

React rendering primitives for stratigraphic columns

14 lines (13 loc) 437 B
"use strict"; const index = require("../../utils/index.cjs"); const unpack = require("../../utils/unpack.cjs"); const { sqrt, atan2, round } = Math; const lab2lch = (...args) => { const [l, a, b] = unpack(args, "lab"); const c = sqrt(a * a + b * b); let h = (atan2(b, a) * index.RAD2DEG + 360) % 360; if (round(c * 1e4) === 0) h = Number.NaN; return [l, c, h]; }; module.exports = lab2lch; //# sourceMappingURL=lab2lch.cjs.map