image-color-tool
图片处理工具
https://gitee.com/wongest/image-color-tool
Install
$ npm i image-color-tool
Usage
import { getImageColor, compress } from 'image-color-tool';
// 获取图片的主题颜色
getImageColor(url)
.then(rgb => {
console.log(rgb)
}, err => {
console.log(err)
})
// 压缩图片尺寸
compress(url, scale)
.then(base64 => {
console.log(base64)
}, err => {
console.log(err)
})