The Lovers

This week I was inspired by Man Ray’s Observatory Time – The Lovers.

observatory-time-the-lovers

Our assignment was making functions. I originally wanted to make a lunar series to complement last week’s solar piece.  I scratched that after I found myself wrangling for too long with PI and bezier vortexes.  I made a full screen of ellipses with randomized grey coloring and for some reason suddenly thought LIPS.  I recently read a book on Lee Miller and must have been influenced by that.  I tried to match the color palette of the lips while maintaining the alternating nature random color.

This assignment was about learning the good habit of functions –  the habit of better organizing our code.  Dano described is as almost a Table of Contents for our code.  If it is done correctly, and named well,  you should be able to understand the bulk of what is going on by looking within the draw function.  My draw function:

function draw() {

background(40);
panel();
lips();
theLovers();
}

 

Full Code-

function preload() {

img = loadImage(‘PM_821183.jpg’);
}

function setup() {
createCanvas(400, 400);

}

function draw() {
background(40);
panel();
lips();
theLovers();
}

function panel(){
for(i =0; i < 400; i+= 30){
for (b =0; b<400; b += 30){
circle(i, 15, b);
}
}
}

function circle(x, y, b){
colorMode(HSB);
//fill((0,0,random(200,250)), 40, 100);
fill((random(200,250),30,random(20,40)), 60, 100);
ellipse(x,y,30,30);
ellipse(x,y+b,30,30);
ellipse(x,y+b,30,30);
ellipse(x,y+b,30,30);
ellipse(x,y+b,30,30);
ellipse(x,y+b,30,30);
ellipse(x,y+b,30,30);
ellipse(x,y+b,30,30);
ellipse(x,y+b,30,30);
}
function lips(){
if (mouseIsPressed){

image(img, 100, 130, 200, 120);
}}

function theLovers(){
strokeWeight(4);

textSize(80);
textStyle(BOLD);
fill(250);
text(“THE”,110, 20,150,100);
text(“LOVERS”,40,270,200,300);

}