Beach at Day or Night – Self-Portrait Processing

Hi! So for this project, I decided to make a portrait of myself at a beach. I made the background first as part of the setup so I can change the value later on. It is sky blue at the start, along with the sun being yellow and the cloud being white. Then I have the sand and the sea, while my figure is at the front.

The main feature of my project I would say is the ability to switch to “Night Mode”, in which when I press a button everything becomes darker and when I click on the screen everything becomes daytime again. Below is an example of me toying around with my project.

https://youtu.be/7TLhmqCURAA

I do not know why but the embedded feature does not work for this link.

Also below is the code for my project.

color rectColor = color(255);
color circleColor = color(255);
color a = color(255);
color b = color(249,215,28);

int count = 1;
void setup(){
  size(500,1000);
  background(135,206,235);
}

void draw(){
  
   //sky blue
  
  
  fill(194,178,128); // sand
  
  beginShape();
  vertex(0,400);
  vertex(0,1000);
  vertex(500,1000);
  endShape(CLOSE);
  
  fill(0,119,190);
  beginShape();
  vertex(0,300);
  vertex(0,400);
  vertex(500,1000);
  vertex(600,1000);
  vertex(600,300);
  endShape(CLOSE);
  
  fill(b);
  ellipse(400,50,60,60); //sun
  
  fill(240,184,160); //skin color
  ellipse(250,350,300,300); //face
  rect(100,500,300,500); //body
  
  pushMatrix();
 
  translate(99,0);
  rotate(radians(10)); //left arm
  rect(50,550,50,500);

  
  
  rotate(radians(335.3)); //right arm
  rect(150,620,50,400);
  
  popMatrix();
  
  fill(255);
  ellipse(200,300,45,30); //left eye
  ellipse(300,300,45,30); //right eye
  
  fill(0);
  ellipse(200,300,20,20); //left pupil
  ellipse(300,300,20,20); //right pupil
  
  fill(255,0,0);
  arc(250,400,120,80,0,3.14); //mouth
  line(190,400,310,400);  //line
  
  fill(0); //hair
  beginShape();
  vertex(110,280);
  vertex(180,205);
  vertex(300,190);
  vertex(370,235);
  endShape(CLOSE);
  
  fill(101,67,33);
  ellipse(180,600,10,10); //left nip
  ellipse(320,600,10,10); //right nip
  
  fill(50,80,120);
  rect(100,900,300,200); // pants
  
  fill(a);
  arc(100,70,100,100,PI,TWO_PI); //for the clouds
  arc(135,70,100,100,0,PI);
  fill(0);
  line(50,70,85,70);
  line(150,70,185,70);
  

}

void keyPressed(){
  background(43,47,119);
  a = color(190,169,222);
  b = color(244,241,201);
}

void mouseClicked(){
  background(135,206,235);
  a = color(255);
  b = color(249,215,28);
}

 

2 thoughts on “Beach at Day or Night – Self-Portrait Processing”

Leave a Reply