UNPKG

@macrostrat/column-components

Version:

React rendering primitives for stratigraphic columns

25 lines (24 loc) 759 B
"use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); const Color = require("../../Color.cjs"); const chroma = require("../../chroma.cjs"); const type = require("../../utils/type.cjs"); const input = require("../input.cjs"); const hex2rgb = require("./hex2rgb.cjs"); const rgb2hex = require("./rgb2hex.cjs"); Color.prototype.hex = function(mode) { return rgb2hex(this._rgb, mode); }; const hex = (...args) => new Color(...args, "hex"); chroma.hex = hex; input.format.hex = hex2rgb; input.autodetect.push({ p: 4, test: (h, ...rest) => { if (!rest.length && type(h) === "string" && [3, 4, 5, 6, 7, 8, 9].indexOf(h.length) >= 0) { return "hex"; } } }); exports.hex = hex; //# sourceMappingURL=index.cjs.map