@macrostrat/column-components
Version:
React rendering primitives for stratigraphic columns
15 lines (14 loc) • 417 B
JavaScript
import { RAD2DEG } from "../../utils/index.js";
import unpack from "../../utils/unpack.js";
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) * RAD2DEG + 360) % 360;
if (round(c * 1e4) === 0) h = Number.NaN;
return [l, c, h];
};
export {
lab2lch as default
};
//# sourceMappingURL=lab2lch.js.map