1 | "use strict";
|
2 |
|
3 | exports.__esModule = true;
|
4 | exports["default"] = complement;
|
5 | var _parseToHsl = _interopRequireDefault(require("./parseToHsl"));
|
6 | var _toColorString = _interopRequireDefault(require("./toColorString"));
|
7 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
8 | 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); }
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 | function complement(color) {
|
32 | if (color === 'transparent') return color;
|
33 | var hslColor = (0, _parseToHsl["default"])(color);
|
34 | return (0, _toColorString["default"])(_extends({}, hslColor, {
|
35 | hue: (hslColor.hue + 180) % 360
|
36 | }));
|
37 | }
|
38 | module.exports = exports.default; |
\ | No newline at end of file |