Factory
scrawl.makeGradient({
name: 'colored-pipes',
endX: '100%',
cyclePalette: true,
colors: [
[0, 'black'],
[99, 'red'],
[199, 'black'],
[299, 'blue'],
[399, 'black'],
[499, 'gold'],
[599, 'black'],
[699, 'green'],
[799, 'black'],
[899, 'lavender'],
[999, 'black']
],
})
scrawl.makeBlock({
name: 'animated-block',
width: 150,
height: 150,
startX: 180,
startY: 120,
handleX: 'center',
handleY: 'center',
strokeStyle: 'coral',
fillStyle: 'colored-pipes',
lineWidth: 2,
method: 'fillAndDraw',
});
export const makeGradient = function (items) {
if (!items) return false;
return new Gradient(items);
};
constructors.Gradient = Gradient;