1 | "use strict";
|
2 |
|
3 | exports.__esModule = true;
|
4 | exports["default"] = getContrast;
|
5 | var _getLuminance = _interopRequireDefault(require("./getLuminance"));
|
6 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | function getContrast(color1, color2) {
|
15 | var luminance1 = (0, _getLuminance["default"])(color1);
|
16 | var luminance2 = (0, _getLuminance["default"])(color2);
|
17 | return parseFloat((luminance1 > luminance2 ? (luminance1 + 0.05) / (luminance2 + 0.05) : (luminance2 + 0.05) / (luminance1 + 0.05)).toFixed(2));
|
18 | }
|
19 | module.exports = exports.default; |
\ | No newline at end of file |