我使用node-vibrant从图像中提取颜色。问题是(对于超过4种颜色的图像),它并不总是提取这4种颜色。这是我的密码:
Vibrant.from(img.src)
.quality(1)
.clearFilters()
.getPalette()
.then((palette) => {console.log(palette)...举例结果:
{活力: e,LightVibrant: e,DarkVibrant: e,静音: null,LightMuted: null,…}对于示例,静音和LightMuted为null。
我试过了,这个回购Vibrant.js是不推荐的,他们说要使用node-vibrant。对于相同的图像,使用较旧的Vibrant.js,我将得到4种颜色:
活力#ea4138 (索引):26 DarkVibrant #a1c1e(索引):26 DarkMuted #040404 (索引):26 LightVibrant #eb494d
有什么方法可以用node-vibrant获得最小颜色吗?
我正在使用React。
发布于 2019-02-03 22:42:51
问题是,我已经使用了3.0.0版本,3.1.1修复了问题。
https://stackoverflow.com/questions/54508183
复制相似问题