UNPKG

color-fns

Version:

Modern JavaScript color utility library.

14 lines 538 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var utils_1 = require("./utils"); function formatRgb(value) { if (!value) { return 'Invalid Color'; } if (typeof value.alpha !== 'undefined' && utils_1.isBetween(0, 0.999)(value.alpha)) { return "rgba(" + value.red + "," + value.green + "," + value.blue + "," + value.alpha + ")"; } return "rgb(" + value.red + "," + value.green + "," + value.blue + ")"; } exports.formatRgb = formatRgb; //# sourceMappingURL=formatRgb.js.map