Py5Shape.get_fill()#

Gets the fill color used for a Py5Shape object.

Examples#

example picture for get_fill()
def setup():
    py5.no_stroke()
    py5.fill(200, 50, 50)
    s = py5.create_shape(py5.RECT, 20, 20, 60, 60)
    py5.shape(s)

    fill = s.get_fill(0)
    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

Signatures#

get_fill(
    index: int,  # vertex index
    /,
) -> int

Updated on September 01, 2022 16:36:02pm UTC