xxxxxxxxxx
51
let y;
function setup(){
createCanvas(800, 800);
noStroke();
y=1;
textAlign(CENTER,CENTER);
}
function draw(){
background (0,255,255);
textSize (32);
fill (255,0,0);
text ('Hello', width/2, height/2);
radialGradient(
width/2, y, 0,//Start pX, pY, start circle radius
width/2, y, 200,//End pX, pY, End circle radius
color(255, 255, 0), //Start color
color(255, 255, 0,0) //End color
);
ellipse(width/2, y, 400, 400);
//shadow();
y = y - 1;
// Reset to the bottom
if (y < -200) {
y = 1000;
}
}
function radialGradient(sX, sY, sR, eX, eY, eR, colorS, colorE){
let gradient = drawingContext.createRadialGradient(
sX, sY, sR, eX, eY, eR
);
gradient.addColorStop(0, colorS);
gradient.addColorStop(1, colorE);
drawingContext.fillStyle = gradient;
}
/*function shadow(){
drawingContext.shadowOffsetX = 50;
drawingContext.shadowOffsetY = 50;
drawingContext.shadowBlur = 30;
drawingContext.shadowColor = color(50, 30, 18);
}*/