xxxxxxxxxx
29
function generateGradientFor(theWidth, theHeight, theC1, theC2, theC3) {
let c1 = theC1;
let c2 = theC2;
let c3 = theC3;
drawingContext.shadowColor = color(0, 0, 0, 200);
drawingContext.shadowBlur = 50;
drawingContext.shadowOffsetY = theHeight / 10;
drawingContext.shadowOffsetX = 0;
let gradient = drawingContext.createLinearGradient(0, 0, 0, theHeight);
gradient.addColorStop(0.0, c1);
gradient.addColorStop(0.5, c2);
gradient.addColorStop(1.0, c3);
drawingContext.fillStyle = gradient;
}
function generateGradientFor2(theWidth, theHeight, theC1, theC2) {
let c1 = theC1;
let c2 = theC2;
drawingContext.shadowColor = color(0, 0, 0, 200);
drawingContext.shadowBlur = 50;
drawingContext.shadowOffsetY = theHeight / 10;
drawingContext.shadowOffsetX = 0;
let gradient = drawingContext.createLinearGradient(0, 0, 0, theHeight);
gradient.addColorStop(0.0, c1);
gradient.addColorStop(1.0, c2);
drawingContext.fillStyle = gradient;
}