mirror of https://github.com/tycrek/ass
parent
43931d3372
commit
c13b789627
@ -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…
Reference in new issue