text: 'use strict';
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  
  var _rgba = /*#__PURE__*/require('./rgba');
  
  var _rgba2 = /*#__PURE__*/_interopRequireDefault(_rgba);
  
  var _parseToRgb = /*#__PURE__*/require('./parseToRgb');
  
  var _parseToRgb2 = /*#__PURE__*/_interopRequireDefault(_parseToRgb);
  
  var _guard = /*#__PURE__*/require('../internalHelpers/_guard');
  
  var _guard2 = /*#__PURE__*/_interopRequireDefault(_guard);
  
  var _curry = /*#__PURE__*/require('../internalHelpers/_curry');
  
  var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  /**
   * Decreases the opacity of a color. Its range for the amount is between 0 to 1.
   *
   *
   * @example
   * // Styles as object usage
   * const styles = {
   *   background: transparentize(0.1, '#fff');
   *   background: transparentize(0.2, 'hsl(0, 0%, 100%)'),
   *   background: transparentize(0.5, 'rgba(255, 0, 0, 0.8)'),
   * }
   *
   * // styled-components usage
   * const div = styled.div`
   *   background: ${transparentize(0.1, '#fff')};
   *   background: ${transparentize(0.2, 'hsl(0, 0%, 100%)')},
   *   background: ${transparentize(0.5, 'rgba(255, 0, 0, 0.8)')},
   * `
   *
   * // CSS in JS Output
   *
   * element {
   *   background: "rgba(255,255,255,0.9)";
   *   background: "rgba(255,255,255,0.8)";
   *   background: "rgba(255,0,0,0.3)";
   * }
   */
  function transparentize(amount, color) {
    var parsedColor = (0, _parseToRgb2.default)(color);
    var alpha = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1;
    var colorWithAlpha = _extends({}, parsedColor, {
      alpha: (0, _guard2.default)(0, 1, (alpha * 100 - amount * 100) / 100)
    });
    return (0, _rgba2.default)(colorWithAlpha);
  }
  
  var curriedTransparentize = /*#__PURE__*/(0, _curry2.default)(transparentize);
  exports.default = curriedTransparentize;
  module.exports = exports['default'];