To Image

toImage #

Returns a p5.Image representation of this quadrille.

Syntax #

toImage(filename, [{[values], [tileDisplay], [imageDisplay], [colorDisplay], [stringDisplay], [numberDisplay], [arrayDisplay], [objectDisplay], [cellLength], [outlineWeight], [outline], [textColor], [textZoom]}])

Parameters #

parameterdescription
filenameString: image name, png and jpg extensions are supported
tileDisplayFunction: empty cell drawing custom procedure default is Quadrille.tileDisplay1. Use 0, null or undefined to discard all edges
imageDisplayFunction: image filled cell drawing custom procedure default is Quadrille.imageDisplay
colorDisplayFunction: color filled cell drawing custom procedure default is Quadrille.colorDisplay
stringDisplayFunction: string filled cell drawing custom procedure default is Quadrille.stringDisplay
numberDisplayFunction: number filled cell drawing custom procedure default is Quadrille.numberDisplay
arrayDisplayFunction: array filled cell drawing custom procedure
objectDisplayFunction: object filled cell drawing custom procedure
valuesIterable: cells to be exported. All cells are exported if this parameter is undefined
cellLengthNumber: edge length in pixels default is Quadrille.cellLength
outlineWeightNumber: edge weight default is Quadrille.outlineWeight.
outlinep5.Color representation: edge color default is Quadrille.outline
textColorp5.Color representation: text color default is Quadrille.textColor
textZoomNumber:: text zoom level default is Quadrille.textZoom

  1. This function allows to implementing other regular tilings different than the default square tiling↩︎