xxxxxxxxxx
let pallete = ["#1B1B1B", "#EB0000", "#FCFEFC"];
//selection of the color palette of the poster tile
function setup() {
createCanvas(600, 600);
noLoop();
rectMode(CENTER);
}
//writing text+ plus placement and color
function draw() {
background(0);
background(255);
tile();
strokeWeight(1);
textSize(20)
fill('white')
text('BE YOU',50,50)
fill('white')
textSize(10)
text('Series projects by poster lad',50,80)
fill('white')
textSize(10)
text('All rights reserved 2018',50,90)
textSize(20)
fill('black')
text('066',480,50)
textStyle('bold')
textSize(10)
fill('black')
text('30 april 2018',460,70)
textStyle('bold')
}
//using tile function to create a various tiles
function tile() {
let b = 6;
let a = width / b;
for (let i = 0; i < b; i++) {
for (let j = 0; j < b; j++) {
let col1 = random(pallete);
let col2 = random(pallete);
let angle = int(random(4)) * HALF_PI;
let hs = a / 2;
push();
translate(i * a + a / 2, j * a + a / 2);
rotate(angle);
noStroke();
fill(col1);
rect(0, 0, a, a);
fill(col2);
arc(-hs, -hs, a * 2, a * 2, 0, HALF_PI);
pop();
}
}
}
//generating a cool visual with the function k
function keyPressed() {
redraw();
}