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 Vibrant = require('node-vibrant');
const { path } = require('./utils'); const { path } = require('./utils');
const COLOR_COUNT = 256;
const QUALITY = 3;
module.exports = (file) => module.exports = (file) =>
new Promise((resolve, reject) => new Promise((resolve, reject) =>
Vibrant.from(path(file.path)).getPalette() Vibrant.from(path(file.path))
.then((palette) => resolve(palette.Vibrant.hex)) .maxColorCount(COLOR_COUNT).quality(QUALITY).getPalette()
.catch(reject)); .catch(reject));

Loading…
Cancel
Save