@macrostrat/column-components
Version:
React rendering primitives for stratigraphic columns
15 lines (14 loc) • 417 B
JavaScript
;
const Color = require("../Color.cjs");
Color.prototype.get = function(mc) {
const [mode, channel] = mc.split(".");
const src = this[mode]();
if (channel) {
const i = mode.indexOf(channel) - (mode.substr(0, 2) === "ok" ? 2 : 0);
if (i > -1) return src[i];
throw new Error(`unknown channel ${channel} in mode ${mode}`);
} else {
return src;
}
};
//# sourceMappingURL=get.cjs.map