New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cloudflare/util-color

Package Overview
Dependencies
Maintainers
17
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cloudflare/util-color - npm Package Compare versions

Comparing version 1.1.13 to 1.1.14

11

CHANGELOG.md

@@ -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 @@

7

es/index.js
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"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc