@macrostrat/column-components
Version:
React rendering primitives for stratigraphic columns
22 lines (21 loc) • 506 B
JavaScript
import "../../utils/type.js";
import unpack from "../../utils/unpack.js";
const cmyk2rgb = (...args) => {
args = unpack(args, "cmyk");
const [c, m, y, k] = args;
const alpha = args.length > 4 ? args[4] : 1;
if (k === 1) return [0, 0, 0, alpha];
return [
c >= 1 ? 0 : 255 * (1 - c) * (1 - k),
// r
m >= 1 ? 0 : 255 * (1 - m) * (1 - k),
// g
y >= 1 ? 0 : 255 * (1 - y) * (1 - k),
// b
alpha
];
};
export {
cmyk2rgb as default
};
//# sourceMappingURL=cmyk2rgb.js.map