xxxxxxxxxx
// let pallete = ["#a5c9c1", "#F2CC5D", "#39324B", "#E25B53","#6B82A8"];
let pallete = ["#533747","#5f506b","#6a6b83","#76949f","#86bbbd"];
const COL = createCols("https://coolors.co/fffc31-5c415d-f6f7eb-e94f37-393e41");
let pg;
let v = 800;
function setup() {
createCanvas(v, windowHeight);
// pg = createGraphics(v, v-100);
pg = createGraphics(v*0.6,v*0.6);
noLoop();
}
function draw() {
// background(200);
pg.background(random(pallete));
pg.noStroke();
pg.fill(COL[int(random(COL.length))]);
pg.circle(pg.width / 2, pg.height / 2, 200);
// eye
pg.fill(255);
pg.stroke(106, 107, 131);
pg.strokeWeight(3);
pg.circle(250,160,30);
pg.circle(200,160,30);
// pupil (of eye)
pg.fill(0);
pg.noStroke();
pg.circle(250,160,15);
pg.circle(200,160,15);
for (let j = 0; j < 50; j += 10) {
for (let i = 0; i < 50; i += 10) {
let x = i * 15;
let y = j * 15;
// image(pg, 150, 150);
// image(pg, 0, 0, 155, 155);
image(pg, x-20, y-50, 255, 255);
}
}
Striped();
}
// 横線
function Striped(){
for(let n=0;n<40;n++){
let h=n*40;
stroke(230, 230, 234,30);
strokeWeight(10);
fill(129, 126, 159,30);
rect(0,h,v,40);
}
}
// URLからのカラー
function createCols(_url) {
let slash_index = _url.lastIndexOf('/');
let pallate_str = _url.slice(slash_index + 1);
let arr = pallate_str.split('-');
for (let i = 0; i < arr.length; i++) {
arr[i] = '#' + arr[i];
}
return arr;
}