@fluentui/react
Version:
Reusable React components for building web experiences.
15 lines • 641 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateA = void 0;
var tslib_1 = require("tslib");
var _rgbaOrHexString_1 = require("./_rgbaOrHexString");
var consts_1 = require("./consts");
/**
* Gets a color with the given alpha value and the same other components as `color`.
* Does not modify the original color.
*/
function updateA(color, a) {
return tslib_1.__assign(tslib_1.__assign({}, color), { a: a, t: consts_1.MAX_COLOR_ALPHA - a, str: (0, _rgbaOrHexString_1._rgbaOrHexString)(color.r, color.g, color.b, a, color.hex) });
}
exports.updateA = updateA;
//# sourceMappingURL=updateA.js.map