computationally-generated artwork; randomly generated vibrant blocks of color are overlayed with text messages from my parents while I was away at school
“Love, Mom and Dad” by suanna zhong
https://openprocessing.org/sketch/1970038
License CreativeCommons Attribution NonCommercial ShareAlike
https://creativecommons.org/licenses/by-nc-sa/3.0
{{filePath}}
{{width}} x {{height}}
Report Sketch
Oh, that naughty sketch! Please let us know what the issue is below.
Apply Template
Applying this template will reset your sketch and remove all your changes. Are you sure you would like to continue?
Report Sketch
Report Comment
Please confirm that you would like to report the comment below.
We will review your submission and take any actions necessary per our Community Guidelines. In addition to reporting this comment, you can also block the user to prevent any future interactions.
Please report comments only when necessary. Unnecessary or abusive use of this tool may result in your own account being suspended.
Are you sure you want to delete your sketch?
Any files uploaded will be deleted as well.
Delete Comment?
This will also delete all the replies to this comment.
Delete this tab? Any code in it will be deleted as well.
Select a collection to submit your sketch
We Need Your Support
Since 2008, OpenProcessing has provided tools for creative coders to learn, create, and share over a million open source projects in a friendly environment.
Niche websites like ours need your continued support for future development and maintenance, while keeping it an ad-free platform that respects your data and privacy!
Please consider subscribing below to show your support with a "Plus" badge on your profile and get access to many other features!
refresh to generate a new pattern
CC Attribution NonCommercial ShareAlike
Love, Mom and Dad
zhong
xxxxxxxxxx
function setup() {
createCanvas(600, 600);
background(238, 226, 217);
}
function draw() {
rectMode(CENTER);
noLoop();
blendMode(BLEND);
background(238, 226, 217);
blendMode(MULTIPLY);
stroke(180, 180, 180, random(0, 255));
// GRIDS
off = random(0, 100);
for (i = 0; i <= 6; i ++) {
line(i*100 + off, 0, i*100 + off, 600);
line(0, i*100 + off, 600, i*100 + off);
}
// MASK
rectMode(CORNER);
coin = random(2, 100);
if (coin < 15) {
blendMode(BURN);
fill(210, 144, 95, random(0, 255));
} else if (coin < 30) {
blendMode(EXCLUSION);
randomColor();
} else if (coin < 45) {
blendMode(DARKEST);
randomColor();
} else {
blendMode(MULTIPLY);
fill(255);
}
rect(0, 0, 600, 600);
// LAYER 1
coin = random(0, 100);
if (coin < 50) {
rainbowRectangles();
} else if (coin < 75) {
idk();
} else {
texts();
}
// LAYER 2
blendMode(BURN);
for (i = 0; i < 20; i ++) {
for (j = 0; j < 20; j++) {
start = random(0, 100);
if (start<5) {
fill(50)
rect(i*30, j*30, 15, 15)
rect(i*30+15, j*30+15, 15, 15)
}
else if (start<15) {
randomColor();
rect(i*30, j*30, floor(random(1, 4))*30, floor(random(1, 4))*30, random(0, 20))
rect(i*30+15, j*30-15, floor(random(1, 4))*30, floor(random(1, 4))*30, random(0, 20));
rect(i*30+15, j*30-15, floor(random(1, 4))*5, floor(random(1, 4))*5);
}
}
}
// another layer
p = random(0, 100);
if (p < 40) {
for (i = 0; i < 5; i ++) {
textFont('Georgia', random(5, 25));
blendMode(OVERLAY);
fill(238, 226, 217, random(0, 255));
text(mom(), i*120, random(0, 600), random(250, 500));
text(dad(), i*120, random(0, 600), random(250, 500));
}
}
stroke(180, 180, 180, random(0, 255));
randomColor();
// FINAL LAYER
numOfShapes = random(0, 20);
iterations = ceil(random(0, 5));
count = 0;
while (count < numOfShapes) {
for (x = 0; x < iterations; x ++) {
randomBlend();
for (i = 0; i < 20; i ++) {
for (j = 0; j < 20; j++) {
start = random(0, 100);
if (start < 8) {
randomColor();
rect(i*30, j*30, floor(random(1, 4))*5, floor(random(1, 4))*5)
rect(i*30+15, j*30-15, floor(random(1, 4))*5, floor(random(1, 4))*5);
count ++;
}
else if (start < 8) {
randomColor();
rect(i*30, j*30, floor(random(1, 4))*5, floor(random(1, 4))*5)
rect(i*30+15, j*30 + 15, floor(random(1, 4))*5, floor(random(1, 4))*5);
count ++;
}
}
}
}
}
}
function randomBlend() {
modes = ["ADD", "EXCLUSION", "SUBTRACT", "SCREEN", "OVERLAY", "BURN", "MULTIPLY"];
string = modes[floor(random(0, 8))];
if (string == "ADD") blendMode(ADD);
else if (string == "EXCLUSION") blendMode(EXCLUSION);
//else if (string == "SUBTRACT") blendMode(SUBTRACT);
else if (string == "SCREEN") blendMode(SCREEN);
else if (string == "OVERLAY") blendMode(OVERLAY);
else if (string == "BURN") blendMode(BURN);
else if (string == "MULTIPLY") blendMode(MULTIPLY);
}
function randomColor() {
colors = ["yellow", "red", "blue"];
colorIndex = int(random(0, 3));
if (colors[colorIndex] == "yellow") fill(255, 246, 0, random(100, 200));
else if (colors[colorIndex] == "red") fill(255, 64, 151, random(100, 200));
else if (colors[colorIndex] == "blue") fill(37, 182, 255, random(100, 200));
}
function drawShape(i, j, dims) {
randomColor();
rect(i*100 + floor(random(-10, 10))*10, j*100 + floor(random(-10, 10))*10,
dims*100 + floor(random(-4, 4))*10, dims*100 + floor(random(-4, 4))*10);
}
function mousePressed() {
loop();
}
function rainbowRectangles(){
for (i = 0; i <= 6; i ++) {
for (j = 0; j <= 6; j++) {
circle(i * 100, j * 100, random(3, 7));
start = random(0, 100);
if (start < 25) {
dims = floor(random(1, 4));
drawShape(i, j, dims);
}
}
}
}
function idk(){
coin = random(0, 100);
if (coin < 50) {
blendMode(LIGHTEST);
fill(238, 226, 217, 25);
for (i = 0; i < 5; i ++) {
for (j = 0; j < 5; j++) {
x = i*120 + 60;
y = j*120 + 60;
size = random(120, 200);
start = random(0, 100);
if (start < 35) {
rect(x, y, size + random(-50, 50), size + random(-50, 50), random(75, 200));
}
}
}
randomColor();
} else if (coin < 75) {
randomBlend();
for (i = 0; i <= 20; i ++) {
for (j = 0; j <= 20; j++) {
start = random(0, 100);
if (start < 30) {
randomColor();
rect(i*30, j*30, floor(random(1, 4))*5, floor(random(1, 4))*5)
rect(i*30+15, j*30-15, floor(random(1, 4))*5, floor(random(1, 4))*5);
}
}
}
}
}
function texts(){
blendMode(BURN);
noStroke();
randomColor();
for (i = 0; i < 5; i ++) {
for (j = 0; j < 5; j++) {
x = i*120 + 60;
y = j*120 + 60;
size = random(130, 400);
start = random(0, 100);
if (start < 35) {
rect(x, y, size + random(-50, 50), size + random(-50, 50), random(75, 200));
}
}
}
amountOfWords = random(0, 5);
stroke(180, 180, 180, random(100, 255));
for (i = 0; i < 5; i ++) {
for (j = 0; j < 20; j++) {
x = i*120;
y = j*30;
textFont('Georgia', random(5, 25));
textAlign(LEFT);
textWrap(WORD);
coin = random(1, 10);
randomColor();
randomBlend();
if (coin < amountOfWords/2) {
text(mom(), x + random(-10, 10), y + random(-10, 10), random(250, 500));
} else if (coin < amountOfWords) {
text(dad(), x + random(-10, 10), y + random(-10, 10), random(100, 500));
}
}
}
noFill();
stroke(180, 180, 180, random(100, 255));
strokeWeight(2);
randomBlend();
textFont('Georgia', 60);
text(dad(), random(-400, 600), random(-400, 400), random(100, 500));
strokeWeight(1);
randomColor();
blendMode(BLEND);
}
function mom() {
options = ["你已经画了一幅画,那就很好了",
"Need sign up first?",
"我找了爸爸的照片,有100pictures。 how can I share them with you?",
"How about line 111 try using argv[0] as input, instead of vicab_filename? ",
"I know. Give it a try",
"it’s getting dark快回家吧",
"我喜欢听火车的声音 relaxing",
"中午你吃的是什么,现在天快黑了吧",
"什么时候的火车?什么时候到Pittsburgh ",
"Don’t be so stressed :-). Things are not so hard. Don’t be scared in front. When you do it, you will see it’s not that hard",
"Dear 树树,Are you all right? Sorry I missed your call. I was running. ",
"I dont recommend coming back",
"你不用再画了:) 我不知道你已经画了,所以给你送照片",
"Ok. I will wait for your unlimited storage:)"]
index = floor(random(0, options.length));
return options[index];
}
function dad() {
options = ["Your image reminds me 20’s year ago a project, rotating/flipping a jpeg image without losing quality Love Dad",
"5:30can eat",
"That is down town San Jose. Not a decent place at night. Please leave as soon as possible ",
"Cs is a class needed lot of practice. You are in the right track",
"But we should have other aspect of life. 8 hours a day of studying time should be normal life ",
"How about the rest of days in the week? Do you feel good?",
"Two hours cant solve a problem, you may shift to other problems. ",
"But you only finished 2 of 10 problems in the home work. How many hours you spent on the home work?",
"Both are important. But calc 3-D is more real. You should take it. You may learn linear algebra by yourself or take the class in the future ",
"f(a) in S then a in S, you may mention injective of f, otherwise we cannot claim a in S ",
"You only prove f(S\andT) included in f(S)\and f(T). You should also prove that f(S) \and f(T) included in f(S\and T)",
"Don’t worry too much. You seriously finished homework, you should get the knowledge then pass the exam"]
index = floor(random(0, options.length));
return options[index];
}
See More Shortcuts