Py5Shape.get_fill()

Gets the fill color used for a Py5Shape object.

Examples

example picture for get_fill()
1
2
3
4
5
6
7
8
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 Java method: PShape.getFill

Syntax

get_fill(index: int, /) -> int

Parameters

  • index: int - vertex index

Updated on September 11, 2021 16:51:34pm UTC