1 | "use strict";
|
2 |
|
3 | exports.__esModule = true;
|
4 | exports["default"] = rgb;
|
5 | var _reduceHexValue = _interopRequireDefault(require("../internalHelpers/_reduceHexValue"));
|
6 | var _numberToHex = _interopRequireDefault(require("../internalHelpers/_numberToHex"));
|
7 | var _errors = _interopRequireDefault(require("../internalHelpers/_errors"));
|
8 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
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 rgb(value, green, blue) {
|
33 | if (typeof value === 'number' && typeof green === 'number' && typeof blue === 'number') {
|
34 | return (0, _reduceHexValue["default"])("#" + (0, _numberToHex["default"])(value) + (0, _numberToHex["default"])(green) + (0, _numberToHex["default"])(blue));
|
35 | } else if (typeof value === 'object' && green === undefined && blue === undefined) {
|
36 | return (0, _reduceHexValue["default"])("#" + (0, _numberToHex["default"])(value.red) + (0, _numberToHex["default"])(value.green) + (0, _numberToHex["default"])(value.blue));
|
37 | }
|
38 | throw new _errors["default"](6);
|
39 | }
|
40 | module.exports = exports.default; |
\ | No newline at end of file |