@macrostrat/column-components
Version:
React rendering primitives for stratigraphic columns
27 lines (26 loc) • 656 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 hsv2rgb from "./hsv2rgb.js";
import rgb2hsl from "./rgb2hsv.js";
Color.prototype.hsv = function() {
return rgb2hsl(this._rgb);
};
const hsv = (...args) => new Color(...args, "hsv");
chroma.hsv = hsv;
input.format.hsv = hsv2rgb;
input.autodetect.push({
p: 2,
test: (...args) => {
args = unpack(args, "hsv");
if (type(args) === "array" && args.length === 3) {
return "hsv";
}
}
});
export {
hsv
};
//# sourceMappingURL=index.js.map