mirror of
https://github.com/mifi/lossless-cut.git
synced 2024-11-22 10:22:31 +01:00
27 lines
461 B
JavaScript
27 lines
461 B
JavaScript
// https://github.com/mock-end/random-color/blob/master/index.js
|
|
/* eslint-disable */
|
|
|
|
const color = require('color');
|
|
|
|
var ratio = 0.618033988749895;
|
|
var hue = 0.65;
|
|
|
|
module.exports = function (saturation, value) {
|
|
hue += ratio;
|
|
hue %= 1;
|
|
|
|
if (typeof saturation !== 'number') {
|
|
saturation = 0.5;
|
|
}
|
|
|
|
if (typeof value !== 'number') {
|
|
value = 0.95;
|
|
}
|
|
|
|
return color({
|
|
h: hue * 360,
|
|
s: saturation * 100,
|
|
v: value * 100,
|
|
});
|
|
};
|