Improved Vibrant colour options

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

@ -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));

Loading…
Cancel
Save