Source

style/getColorWithAlpha.js

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var convertColorToRgbaArray_1 = __importDefault(require("./convertColorToRgbaArray"));
/**
 * Add alpha info the given color code.
 * @param color Color code in hex or rgb(a)
 * @param alpha Alpha value. 0 - 1.
 * @category style
 * @module getColorWithAlpha
 */
var getColorWithAlpha = function (color, alpha) {
    var _a = (0, convertColorToRgbaArray_1.default)(color), r = _a[0], g = _a[1], b = _a[2];
    return "rgba(".concat([r, g, b, alpha].join(','), ")");
};
exports.default = getColorWithAlpha;