Week 2 – Simple Work of Art

I was unsure how to approach this assignment. I am new to coding, and I am also not an artist in any way, shape, or form. Coming up with ideas was difficult, as I am not used to looking for inspiration and executing the vision. Most of my initial ideas were to try and replicate or recreate existing pieces of art, but I felt that was too uncreative. When I began to formulate my own ideas, I quickly became frustrated, as I would often bite off more than I could chew, and very quickly realize that I could not execute my own vision. In the end, I settled on trying to recreate a picture I took recently of a sunset over the beach.

My beach photo

I thought that this would provide some new challenges, while also not being too busy, and hopefully looking good in the end. I was looking forward to figuring out the gradient, and getting some movement in the grass and the sun. I basically wanted to create a GIF. The toughest thing for me to work out was the grass, which I wanted to move. I tried creating random ellipses, at first, but I didn’t like the way it looked. In the end, I used arcs, which I think worked out well. I also got the sun to set behind the sand and reappear at the top of the screen, which I thought was a cool effect.

float x = 0;
float y = 0;
float circleY;
float ySpeed=2;

void setup(){
  // Define colors
  b1 = color(255,218,185);
  b2 = color(188,143,143);
  c1 = color(255);
  c2 = color(0);


int Y_AXIS = 1;
int X_AXIS = 2;
color b1, b2, c1, c2;

void draw() {
  setGradient(0, 0, width, height/2, b2, b1, X_AXIS);
  circleY = circleY + ySpeed;

  void setGradient(int x, int y, float w, float h, color c1, color c2, int axis ) {
  if (axis == X_AXIS) {
    for (int i = x; i <= x+h; i++) {
      float inter = map(i, x, x+h, 0, 1);
      color b = lerpColor(b1, b2, inter);
      line(x, i, x+w, i);

void grass() {
  for (int i =0; i<width; i+=1) {
    arc(i+random(8), height/1.5-random(height/6), i, 100, radians(0), radians(45));


Leave a Reply