xxxxxxxxxx
// Declare variables for color values
let cyann;
let yelloww;
let greenn;
let bej;
// Declare variables for fonts and grid size
let titleF;
let gSize = 110;
function preload() {
titleF = loadFont('Montage-Demo.ttf');
}
function setup() {
createCanvas(500, 700);
bej = color(245, 245, 220);
background(bej);
// Define color values with opacities
cyann = color(52, 158, 235, 180);
yelloww = color(235, 235, 52, 200);
greenn = color(29, 168, 22, 150);
// Prevent the draw loop from continuously executing
noLoop();
}
function draw() {
// Draw top circle
noStroke();
fill(cyann);
ellipse(width / 2, height / 4+ 40, 400, 400);
// Draw middle circle
fill(greenn);
ellipse(width / 2, height / 2, 400, 400);
// Draw bottom circle
fill(yelloww);
ellipse(width / 2, (3 * height) / 4- 40, 400, 400);
// text1
textAlign(CENTER);
fill(0);
textSize(22);
text('a Pelican Book', width / 2, 33);
// Draw line
stroke(0);
line(0, 50, width, 50);
// pg number
textAlign(RIGHT);
text('95c', width - 10, 33);
// text2
textAlign(LEFT);
textFont(titleF);
textSize(50);
textLeading(50)
text('The Divided Self', width / 2-80, 100, 200);
// Draw line
line(0, 170, width, 170);
// text3
textSize(30);
text('R.D.Liang', width / 2- 40, 210, 300);
// Draw line
line(0, 230, width, 230);
}