@macrostrat/column-components
Version:
React rendering primitives for stratigraphic columns
30 lines (29 loc) • 819 B
JavaScript
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 lab2rgb from "./lab2rgb.js";
import rgb2lab from "./rgb2lab.js";
import { setLabWhitePoint, getLabWhitePoint } from "./lab-constants.js";
Color.prototype.lab = function() {
return rgb2lab(this._rgb);
};
const lab = (...args) => new Color(...args, "lab");
Object.assign(chroma, { lab, getLabWhitePoint, setLabWhitePoint });
input.format.lab = lab2rgb;
input.autodetect.push({
p: 2,
test: (...args) => {
args = unpack(args, "lab");
if (type(args) === "array" && args.length === 3) {
return "lab";
}
}
});
export {
getLabWhitePoint,
lab,
setLabWhitePoint
};
//# sourceMappingURL=index.js.map