我正在使用https://jariz.github.io/vibrant.js/从图像中获取颜色,在他们的网站上,他们显示了示例,其中还显示了最白的颜色(LightMuted),但是我可以获得任何其他值,但 LightMuted 什么也不返回对我来说,我怎样才能得到那种颜色?我试着像这样使用它:
albumart.addEventListener('load', function () {
var vibrant = new Vibrant(albumart);
var swatches = vibrant.swatches()
for (var swatch in swatches)
if (swatches.hasOwnProperty(swatch) && swatches[swatch]) {
var name = (swatches.LightMuted.getHex()); // Nothing
var details = (swatches.DarkVibrant.getHex()); // Returns color