fill(row, col, value, border)
Fills a specific cell and all connected cells holding the same value as it with value via flood fill; with border = true, the rim where the flood stops is filled too.
Example
(click on any cell to perform flood fill with selected border option; press any key to reset)
Note
Connected means same value, and sameness is identity (
===) — see clear(row, col, directions) for the identity note and clear(row, col, border) for the rim semantics; here the rim is filled withvalueinstead of cleared.
Syntax
fill(row, col, value, border)
Parameters
| Param | Description |
|---|---|
row |
Number: row index of the cell to start filling [0..height] |
col |
Number: column index of the cell to start filling [0..width] |
value1 |
Any: A valid JavaScript value |
border |
Boolean: Specifies whether to include the border of the flood fill area. Default is false |
What this page's examples use
- p5.quadrille
drawQuadrillecreateQuadrillecellLengthmouseRowmouseColrandfill- p5.js
createCanvasbackgroundcolorvaluecreateSelectoptionselected
Names the analysis can prove are called, and the line each one is documented on. Local variables and members of an unknown receiver are left out.