Vibrant now selects the most common colour out of the image

pull/19/head
tycrek 3 years ago
parent c13b789627
commit da262e5f17
No known key found for this signature in database
GPG Key ID: 25D74F3943625263

@ -8,4 +8,5 @@ module.exports = (file) =>
new Promise((resolve, reject) =>
Vibrant.from(path(file.path))
.maxColorCount(COLOR_COUNT).quality(QUALITY).getPalette()
.then((palettes) => resolve(palettes[Object.keys(palettes).sort((a, b) => palettes[b].population - palettes[a].population)[0]].hex))
.catch(reject));

Loading…
Cancel
Save