xxxxxxxxxx
176
let offset;
let arcs;
let pacs;
let windowScale;
//https://www.colorpalettehub.com/vaporwave-color-palettes
let vaporwave = [
"#080d3e",
"#d069a4",
"#233ac8",
"#151c8d",
"#4994f9"
];
// chromotome palettes
const miradors = ["#020202", "#ff6936", "#fddc3f", "#0075ca", "#03bb70"];
const powerpuff = ["#201010", "#5dece1", "#ea50c4", "#47e752", "#130d0d"];
const butterfly = ["#191e36", "#f40104", "#f6c0b3", "#99673a", "#f0f1f4"];
const cc239 = ["#e0eff0", "#e3dd34", "#78496b", "#f0527f", "#a7e0e2"];
const monochrome = [
"#000000",
"#333333",
"#666666",
"#999999",
"#cccccc",
"#eeeeee",
"#ffffff",
];
const jung_hippo = ["#ffffff", "#fe7bac", "#ff921e", "#3da8f5", "#7ac943"];
const dt02 = [
"#000000", // added
"#eee3d3",
"#302956",
"#f3c51a",
];
const frozen_rose = ["#f2e8e4", "#2a358f", "#e9697b", "#1b164d", "#f6d996"];
const foxshelter = ["#dddddd", "#ff3931", "#007861", "#311f27", "#bab9a4"];
const revolucion = [
"#2d1922",
"#ed555d",
"#fffcc9",
"#41b797",
"#eda126",
"#7b5770",
];
const cc245 = ["#f6f4ed", "#0d4a4e", "#ff947b", "#ead3a2", "#5284ab"];
let palettes = [
"miradors",
"powerpuff",
"butterfly",
"cc239",
"monochrome",
"jung hippo",
"dt02",
"frozen rose",
"foxshelter",
"revolucion",
"cc245",
"vaporwave",
];
let palette, _palette;
function setup() {
createCanvas(3000, 3000);
windowScale = 1000/width;
offset = width * 0.025;
noFill();
let _p = getRandomPalette();
palette = _p.palette;
_palette = _p.name;
pacs = random([true,false]);
arcs = [];
let mode = random([/*CHORD,*/ OPEN, PIE]);
for (let r = 0; r < width * 0.75; r += random(5,15)*windowScale) {
let start = random(TWO_PI);
let shadow = random([true,false]);
arcs.push({
color: color(random(palette)),
start: start,
end: start + random(TWO_PI),
step: PI/(random([-1,1])*random(32,256)),
r: r,
shadow: shadow,
mode:mode,
shadowSize: random(5,50)*windowScale,
});
}
strokeWeight(2.5*windowScale);
frameRate(60);
}
let paused = false;
function keyPressed() {
if (key == ' ') paused = !paused;
}
function draw() {
if (!paused) {
background(220);
drawShadow(0,0,15*windowScale,color(20));
noStroke();
fill(20);
rect(offset,offset,width-2*offset,height-2*offset);
translate(width/2, height/2);
if (!pacs)
noFill();
for (let i = arcs.length-1; i >= 0; i--) {
let a = arcs[i];
// for (let a of arcs) {
drawShadow(0,0,a.shadowSize,color(a.color))
stroke(a.color);
if (a.shadow) {
arc(0,0,a.r, a.r, a.start, a.end, a.mode);
} else {
arc(0,0,a.r, a.r, a.start, a.end);
}
a.start += a.step;
a.end += a.step;
}
}
}
function drawShadow(x, y, b, c, g = null) {
if (g == null) {
drawingContext.shadowOffsetX = x;
drawingContext.shadowOffsetY = y;
drawingContext.shadowBlur = b;// * scale;
drawingContext.shadowColor = c;
} else {
g.drawingContext.shadowOffsetX = x;
g.drawingContext.shadowOffsetY = y;
g.drawingContext.shadowBlur = b;// * scale;
g.drawingContext.shadowColor = c;
}
}
function getRandomPalette() {
let ret_palette;
let _palette = random(palettes);
if (_palette == "miradors") ret_palette = miradors;
else if (_palette == "powerpuff") ret_palette = powerpuff;
else if (_palette == "butterfly") ret_palette = butterfly;
else if (_palette == "cc239") ret_palette = cc239;
else if (_palette == "jung hippo") ret_palette = jung_hippo;
else if (_palette == "dt02") ret_palette = dt02;
else if (_palette == "frozen rose") ret_palette = frozen_rose;
else if (_palette == "foxshelter") ret_palette = foxshelter;
else if (_palette == "revolucion") ret_palette = revolucion;
else if (_palette == "cc245") ret_palette = cc245;
else ret_palette = monochrome;
return { 'name': _palette, 'palette': ret_palette };
}