@adeira/css-colors
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -7,3 +7,3 @@ { | ||
"homepage": "https://github.com/adeira/universe/tree/master/src/css-colors", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"sideEffects": false, | ||
@@ -10,0 +10,0 @@ "private": false, |
@@ -32,2 +32,16 @@ Utility functions for working with CSS/HTML colors. | ||
## Is the color bright or dark? | ||
This function can be used to detect whether the color is bright or dark so you can decide whether you should use white or black text for the color background (for example). | ||
```js | ||
import { isDark, isBright } from '@adeira/css-colors'; | ||
isDark([0, 0, 0]); // true (it's black) | ||
isBright([0, 0, 0]); // false | ||
isDark([255, 255, 255]); // false (it's white) | ||
isBright([255, 255, 255]); // true | ||
``` | ||
## Normalize colors | ||
@@ -34,0 +48,0 @@ |
@@ -26,2 +26,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "isBright", { | ||
enumerable: true, | ||
get: function get() { | ||
return _isBright.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "isColor", { | ||
@@ -33,2 +39,8 @@ enumerable: true, | ||
}); | ||
Object.defineProperty(exports, "isDark", { | ||
enumerable: true, | ||
get: function get() { | ||
return _isDark.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "normalizeColor", { | ||
@@ -47,4 +59,8 @@ enumerable: true, | ||
var _isBright = _interopRequireDefault(require("./isBright")); | ||
var _isColor = _interopRequireDefault(require("./isColor")); | ||
var _isDark = _interopRequireDefault(require("./isDark")); | ||
var _normalizeColor = _interopRequireDefault(require("./normalizeColor")); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30274
31
275
64
1