"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.fadeColor = exports.BRACKET_REGEX = void 0;

var _color = _interopRequireDefault(require("color"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var BRACKET_REGEX = /\((.*)\)/;
exports.BRACKET_REGEX = BRACKET_REGEX;

var fadeColor = function fadeColor(color, fade) {
  var colorObject = (0, _color["default"])(color).fade(fade).string();
  var rgba = colorObject.match(BRACKET_REGEX)[1].split(', ');
  var roundedValpha = parseFloat(rgba[3]).toFixed(2);
  return "rgba(".concat(rgba[0], ", ").concat(rgba[1], ", ").concat(rgba[2], ", ").concat(roundedValpha, ")");
};

exports.fadeColor = fadeColor;