1 | "use strict";
|
2 |
|
3 | exports.__esModule = true;
|
4 | exports["default"] = void 0;
|
5 | var _curry = _interopRequireDefault(require("../internalHelpers/_curry"));
|
6 | var _guard = _interopRequireDefault(require("../internalHelpers/_guard"));
|
7 | var _parseToHsl = _interopRequireDefault(require("./parseToHsl"));
|
8 | var _toColorString = _interopRequireDefault(require("./toColorString"));
|
9 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
10 | function _extends() { _extends = Object.assign ? Object.assign.bind() : 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; }; return _extends.apply(this, arguments); }
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | function saturate(amount, color) {
|
37 | if (color === 'transparent') return color;
|
38 | var hslColor = (0, _parseToHsl["default"])(color);
|
39 | return (0, _toColorString["default"])(_extends({}, hslColor, {
|
40 | saturation: (0, _guard["default"])(0, 1, hslColor.saturation + parseFloat(amount))
|
41 | }));
|
42 | }
|
43 |
|
44 |
|
45 | var curriedSaturate = (0, _curry["default"] )(saturate);
|
46 | var _default = exports["default"] = curriedSaturate;
|
47 | module.exports = exports.default; |
\ | No newline at end of file |