fill(row, col, value)

Fills a specific cell in the quadrille with the specified value.

Example #

(click on any cell to fill it with white; press any key to reset)

code
Quadrille.cellLength = 20;  
let quadrille;  

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

function draw() {  
  background('black');  
  drawQuadrille(quadrille);  
}  

function mouseClicked() {  
  const row = quadrille.mouseRow;  
  const col = quadrille.mouseCol;  
  quadrille.fill(row, col, 255);  
}  

function keyPressed() {  
  reset();  
}  

function reset() {  
  quadrille = createQuadrille(20, 20, 100, color('red'));  
  quadrille.rand(100, color('lime')).rand(100, color('blue'));
}  

Syntax #

fill(row, col, value)

Parameters #

ParamDescription
rowNumber: row number of the cell to fill [0..height]
colNumber: column number of the cell to fill [0..width]
valueAny: A valid JavaScript value