UNPKG

@macrostrat/column-components

Version:

React rendering primitives for stratigraphic columns

27 lines (26 loc) 656 B
import type from "../../utils/type.js"; import unpack from "../../utils/unpack.js"; import chroma from "../../chroma.js"; import Color from "../../Color.js"; import input from "../input.js"; import hsl2rgb from "./hsl2rgb.js"; import rgb2hsl from "./rgb2hsl.js"; Color.prototype.hsl = function() { return rgb2hsl(this._rgb); }; const hsl = (...args) => new Color(...args, "hsl"); chroma.hsl = hsl; input.format.hsl = hsl2rgb; input.autodetect.push({ p: 2, test: (...args) => { args = unpack(args, "hsl"); if (type(args) === "array" && args.length === 3) { return "hsl"; } } }); export { hsl }; //# sourceMappingURL=index.js.map