You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
480 B
JavaScript

const Jimp = require("jimp")
async function generateColorbar() {
const base = await Jimp.create(300, 8, '#e7e2dc')
const pixel = await Jimp.create(1, 8, '#788ea5')
for (let i=0; i < 300; i++) {
const hue = i
base.composite(
pixel.color([
{apply: 'spin', params: [1]}
]),
i,
0,
{ mode: Jimp.BLEND_SOURCE_OVER }
)
}
return base
}
generateColorbar().then( (result) => {
result.write('./web/public/img/colorbar.png')
})