1 | "use strict";
|
2 |
|
3 | exports.__esModule = true;
|
4 | exports["default"] = invert;
|
5 | var _parseToRgb = _interopRequireDefault(require("./parseToRgb"));
|
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 |
|
32 | function invert(color) {
|
33 | if (color === 'transparent') return color;
|
34 |
|
35 | var value = (0, _parseToRgb["default"])(color);
|
36 | return (0, _toColorString["default"])(_extends({}, value, {
|
37 | red: 255 - value.red,
|
38 | green: 255 - value.green,
|
39 | blue: 255 - value.blue
|
40 | }));
|
41 | }
|
42 | module.exports = exports.default; |
\ | No newline at end of file |