Color Display

colorDisplay #

Static method for drawing cells that are filled with colors.

Used by drawQuadrille and sample.

Example #

code
let color;

function setup() {
  createCanvas(165, 165);
  color = createColorPicker('magenta');
}

function draw() {
  background('blue');
  Quadrille.colorDisplay({graphics: this, value: color.value(), cellLength: width});
}

Syntax #

Quadrille.colorDisplay({graphics, value, [cellLength]})

Parameters #

parameterdescription
graphicsp5.Graphics: renderer target
valuep5.Color: cell contents
cellLengthNumber: edge length in pixels default is Quadrille.cellLength