From da262e5f17a4fd98dc845d21a0407673b9e3f8d9 Mon Sep 17 00:00:00 2001 From: tycrek Date: Wed, 16 Jun 2021 00:43:35 -0600 Subject: [PATCH] Vibrant now selects the most common colour out of the image --- vibrant.js | 1 + 1 file changed, 1 insertion(+) diff --git a/vibrant.js b/vibrant.js index 0be33d5..345712c 100644 --- a/vibrant.js +++ b/vibrant.js @@ -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));