From c13b7896275ddd8d95fc2cff28c5e2a90b989757 Mon Sep 17 00:00:00 2001 From: tycrek Date: Wed, 16 Jun 2021 00:43:19 -0600 Subject: [PATCH] Improved Vibrant colour options --- vibrant.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vibrant.js b/vibrant.js index 911cb67..0be33d5 100644 --- a/vibrant.js +++ b/vibrant.js @@ -1,7 +1,11 @@ const Vibrant = require('node-vibrant'); const { path } = require('./utils'); + +const COLOR_COUNT = 256; +const QUALITY = 3; + module.exports = (file) => new Promise((resolve, reject) => - Vibrant.from(path(file.path)).getPalette() - .then((palette) => resolve(palette.Vibrant.hex)) + Vibrant.from(path(file.path)) + .maxColorCount(COLOR_COUNT).quality(QUALITY).getPalette() .catch(reject));