@cloudflare/util-color
Advanced tools
Comparing version 1.1.13 to 1.1.14
@@ -6,2 +6,13 @@ # Change Log | ||
## [1.1.14](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/util-color@1.1.13...@cloudflare/util-color@1.1.14) (2021-09-14) | ||
### Bug Fixes | ||
* **util-color:** DESSYS-917 Dark mode change ([84f6788](http://stash.cfops.it:7999/fe/stratus/commits/84f6788)) | ||
## [1.1.13](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/util-color@1.1.12...@cloudflare/util-color@1.1.13) (2021-04-23) | ||
@@ -8,0 +19,0 @@ |
import tinycolor from 'tinycolor2'; | ||
export var isDark = function isDark(color) { | ||
return tinycolor(color).getBrightness() < 160; | ||
export const isDark = color => { | ||
const brightness = tinycolor(color).getBrightness(); // TODO Read from external function | ||
const invert = document.documentElement.classList.contains('dark-mode'); | ||
return invert ? brightness >= 160 : brightness < 160; | ||
}; |
@@ -13,5 +13,8 @@ "use strict"; | ||
var isDark = function isDark(color) { | ||
return (0, _tinycolor.default)(color).getBrightness() < 160; | ||
var brightness = (0, _tinycolor.default)(color).getBrightness(); // TODO Read from external function | ||
var invert = document.documentElement.classList.contains('dark-mode'); | ||
return invert ? brightness >= 160 : brightness < 160; | ||
}; | ||
exports.isDark = isDark; |
{ | ||
"name": "@cloudflare/util-color", | ||
"description": "Color handling utils", | ||
"version": "1.1.13", | ||
"version": "1.1.14", | ||
"main": "lib/index.js", | ||
@@ -27,3 +27,3 @@ "module": "es/index.js", | ||
}, | ||
"gitHead": "3b74aee5f2437d3981de017126c02cd66ffbeb2d" | ||
"gitHead": "1e801a7ac1f15d9c14896523413211fd12ba83f5" | ||
} |
4266
18