@fluentui/react
Version:
Reusable React components for building web experiences.
15 lines • 653 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports._rgbaOrHexString = void 0;
var consts_1 = require("./consts");
/**
* @internal
* Get a CSS color string from some color components.
* If `a` is specified and not 100, returns an `rgba()` string.
* Otherwise returns `hex` prefixed with #.
*/
function _rgbaOrHexString(r, g, b, a, hex) {
return a === consts_1.MAX_COLOR_ALPHA || typeof a !== 'number' ? "#".concat(hex) : "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(a / consts_1.MAX_COLOR_ALPHA, ")");
}
exports._rgbaOrHexString = _rgbaOrHexString;
//# sourceMappingURL=_rgbaOrHexString.js.map