fast-average-color-node
Advanced tools
Comparing version 0.1.0 to 1.0.0
@@ -17,4 +17,4 @@ "use strict"; | ||
const imageData = context.getImageData(0, 0, width, height); | ||
return fac.getColorFromArray4(imageData.data, options); | ||
return fac.prepareResult(fac.getColorFromArray4(imageData.data, options)); | ||
} | ||
exports.getAverageColor = getAverageColor; |
{ | ||
"name": "fast-average-color-node", | ||
"version": "0.1.0", | ||
"description": "A simple library that calculates the average color of images, videos and canvas in Node.js.", | ||
"version": "1.0.0", | ||
"description": "A simple library that calculates the average color of images in Node.js.", | ||
"main": "dist/index.js", | ||
@@ -14,3 +14,3 @@ "keywords": [ | ||
"canvas": "^2.6.1", | ||
"fast-average-color": "^6.1.1" | ||
"fast-average-color": "^6.2.0" | ||
}, | ||
@@ -34,3 +34,4 @@ "files": [ | ||
"test": "jest", | ||
"build": "tsc -p tsconfig.json" | ||
"build": "tsc -p tsconfig.json", | ||
"prepare": "npm run build" | ||
}, | ||
@@ -37,0 +38,0 @@ "author": { |
@@ -1,5 +0,5 @@ | ||
# Fast Average Color for Node.js | ||
# [Fast Average Color](https://github.com/fast-average-color/fast-average-color/) for Node.js | ||
[![NPM version](https://img.shields.io/npm/v/fast-average-color-node.svg)](https://www.npmjs.com/package/fast-average-color-node) | ||
[![NPM Downloads](https://img.shields.io/npm/dm/fast-average-color-node.svg?style=flat)](https://www.npmjs.org/package/fast-average-color-node) | ||
[![Dependency Status](https://img.shields.io/david/fast-average-color-node/fast-average-color-node.svg)](https://david-dm.org/fast-average-color-node/fast-average-color-node) | ||
[![Dependency Status](https://img.shields.io/david/fast-average-color/fast-average-color-node.svg)](https://david-dm.org/fast-average-color/fast-average-color-node) | ||
@@ -37,3 +37,3 @@ A simple library that calculates the average color of any images for Node.js. | ||
/** | ||
* @param {string | Buffer} filename, Buffer or data64 string | ||
* @param {string | Buffer} [filename] filename, Buffer or data64 string | ||
* @param {Object} [options] | ||
@@ -72,1 +72,5 @@ * @param {number[]} [options.defaultColor=[0, 0, 0, 0]] | ||
MIT License | ||
## Links | ||
- [fast-average-color](https://github.com/fast-average-color/fast-average-color/) | ||
@@ -6,3 +6,3 @@ import { createCanvas, loadImage } from 'canvas'; | ||
export async function getAverageColor(filename: string | Buffer, options?: IFastAverageColorOptions): Promise<IFastAverageColorRgba> { | ||
export async function getAverageColor(filename: string | Buffer, options?: IFastAverageColorOptions): Promise<IFastAverageColorResult> { | ||
const image = await loadImage(filename); | ||
@@ -17,3 +17,3 @@ const { width, height } = image; | ||
return fac.getColorFromArray4(imageData.data, options); | ||
return fac.prepareResult(fac.getColorFromArray4(imageData.data, options)); | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5760
1
75
Updatedfast-average-color@^6.2.0