UNPKG

lib-colors

Version:

Simple node.js library for work with colors

34 lines (33 loc) 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.rgb = exports.hsl = exports.hex = exports.gray = exports.cmyk = exports.RGB = exports.HSL = exports.Gray = exports.CMYK = void 0; const cmyk_class_1 = require("./cmyk/cmyk.class"); Object.defineProperty(exports, "CMYK", { enumerable: true, get: function () { return cmyk_class_1.CMYK; } }); const gray_class_1 = require("./gray/gray.class"); Object.defineProperty(exports, "Gray", { enumerable: true, get: function () { return gray_class_1.Gray; } }); const hsl_class_1 = require("./hsl/hsl.class"); Object.defineProperty(exports, "HSL", { enumerable: true, get: function () { return hsl_class_1.HSL; } }); const rgb_class_1 = require("./rgb/rgb.class"); Object.defineProperty(exports, "RGB", { enumerable: true, get: function () { return rgb_class_1.RGB; } }); const cmyk = (c, m, y, k, a) => { return new cmyk_class_1.CMYK(c, m, y, k, a); }; exports.cmyk = cmyk; const gray = (g, a) => { return new gray_class_1.Gray(g, a); }; exports.gray = gray; const hex = (hex) => { const rgb = new rgb_class_1.RGB(); rgb.fromHex(hex); return rgb; }; exports.hex = hex; const hsl = (h, s, l, a) => { return new hsl_class_1.HSL(h, s, l, a); }; exports.hsl = hsl; const rgb = (r, g, b, a) => { return new rgb_class_1.RGB(r, g, b, a); }; exports.rgb = rgb;