UNPKG

627 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports._rgbaOrHexString = void 0;
4var consts_1 = require("./consts");
5/**
6 * @internal
7 * Get a CSS color string from some color components.
8 * If `a` is specified and not 100, returns an `rgba()` string.
9 * Otherwise returns `hex` prefixed with #.
10 */
11function _rgbaOrHexString(r, g, b, a, hex) {
12 return a === consts_1.MAX_COLOR_ALPHA || typeof a !== 'number' ? "#" + hex : "rgba(" + r + ", " + g + ", " + b + ", " + a / consts_1.MAX_COLOR_ALPHA + ")";
13}
14exports._rgbaOrHexString = _rgbaOrHexString;
15//# sourceMappingURL=_rgbaOrHexString.js.map
\No newline at end of file