Color Field

Under Construction

How would you describe Mark Rothko’s paintings?

p5.js Web Editor

Relations

Equality

Inequality

Relations Review

Control Structures

Conditions

Loops

Control Structures Review

Solutions

Testing

Regions

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

function draw() {
  for (let y = 0; y < height; y++) {
    for (let x = 0; x < width; x++) {
      if (y < f()) {
        stroke(255, 162, 0);
        point(x, y);
      }
      
      if (y >= f() && y < g()) {
        stroke(222, 0, 7);
        point(x, y);
      }
      
      if (y >= g()) {
        stroke(249, 96, 0);
        point(x, y);
      }
    }
  }
}

function f() {
  return height/2;
}

function g() {
  return 5*height/8;
}

Solutions Review

Project Ideas

Polynomials Add x as a parameter to f() and g() and use it to implement functions like and . Update your calls to f(x) and g(x) while drawing the system.

Abstraction Research Piet Mondrian and develop your own abstraction.


This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.