Thursday, June 29, 2017

Example 5 - Color and noFill

// Example 5 - Color and noFill


function setup() {

  var border = 100; 

  createCanvas(640, 480);
  // red = 255, no green, no blue
  background(255, 0, 0);

  // red = green = blue = 64 (gray)
  stroke(64);
  strokeWeight(8);
  noFill();

  // rect border from the sides
  rect(border, border,
       width - 2 * border, height - 2 * border);
}

Output:


No comments:

Post a Comment