Py5Shape.get_fill()#

Gets the fill color used for a Py5Shape object.

Examples#

example picture for get_fill()
1def setup():
2    py5.no_stroke()
3    py5.fill(200, 50, 50)
4    s = py5.create_shape(py5.RECT, 20, 20, 60, 60)
5    py5.shape(s)
6
7    fill = s.get_fill(0)
8    py5.println(py5.red(fill), py5.green(fill), py5.blue(fill)) # 200, 50, 50

Description#

Gets the fill color used for a Py5Shape object. This method can get the fill assigned to each vertex, but most likely the value will be the same for all vertices.

This method can only be used for a complete Py5Shape object, and never within a Py5Shape.begin_shape() and Py5Shape.end_shape() pair.

Underlying Processing method: PShape.getFill

Syntax#

get_fill(index: int, /) -> int

Parameters#

  • index: int - vertex index

Updated on November 12, 2021 11:30:58am UTC