GiC (Gestalten in Code) Lang

Back to examples

Perspective Through Contrast

Perspective Through Contrast thumbnail

Adapted from Fabian's through-contrast sketch, a gray field and a lighter top band extending to 74 pixels frame two black-and-white rectangles at y=27 with a height of 66 pixels. The rectangles overlap both regions, so their contrast changes across the horizontal boundary. Their positions and sizes preserve the source's normalized composition on GIC's square canvas.

// ABOUTME: Contrasts black and white rectangles against a gray field.
// ABOUTME: Fits Fabian's wide contrast composition to a square canvas.
// Source: https://snippets.qawsed.site/p5js/perspective/through-contrast/index.js
background(60, 0, 0);
noStroke();
fill(68, 0, 0);
rect(0, 0, WIDTH, 74);
fill("black");
rect(15, 27, 30, 66);
fill("white");
rect(55, 27, 30, 66);