extract-colors
Advanced tools
Comparing version 1.1.2 to 1.1.3
{ | ||
"name": "extract-colors", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Extract color palettes from images", | ||
@@ -5,0 +5,0 @@ "main": "dist/extract-colors.cjs.js", |
# Extract Colors | ||
Extract color palettes from images. | ||
Simple use, <5ko minified and no dependencies for browser. Dependency to canvas for node.js | ||
Extract color palettes from images. | ||
Simple use, < 5ko minified, fast process and no dependencies for browser. | ||
Dependency to canvas for node.js | ||
![3 examples of colors extraction](./doc/colors.jpg) | ||
@@ -12,3 +14,3 @@ ## Install | ||
```bash | ||
npm install 'extract-colors' | ||
npm install extract-colors | ||
``` | ||
@@ -21,3 +23,3 @@ | ||
```bash | ||
npm install 'extract-colors' 'canvas' | ||
npm install extract-colors canvas | ||
``` | ||
@@ -46,5 +48,5 @@ | ||
const src = './my-image.jpg' | ||
const src = path.join(__dirname, './my-image.jpg') | ||
extractColors(path.join(__dirname, src)) | ||
extractColors(src) | ||
.then(console.log) | ||
@@ -68,3 +70,5 @@ .catch(console.log) | ||
extractColors(src, options).then(console.log) | ||
extractColors(src, options) | ||
.then(console.log) | ||
.catch(console.error) | ||
``` | ||
@@ -78,3 +82,3 @@ | ||
**distance** | ||
_From 0 to 1 is the color distance to not have near colors (1 distance is between White and Black)_ | ||
_From 0 to 1 is the color distance to not have near colors (1 distance is between white and black)_ | ||
Type: `Number` | ||
@@ -84,3 +88,3 @@ Default: `0.2` | ||
**saturationImportance** | ||
_Power of the saturation weight during the process (0 is not used, 1 is equal only saturaton and not area size)_ | ||
_Power of the saturation weight during the process (0 is not used, 1 is only saturation and not area size)_ | ||
Type: `Number` | ||
@@ -87,0 +91,0 @@ Default: `0.2` |
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
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
13087
129