Attributes

fill()

p5.fill(*fill_args, **fill_kwargs)

Set the fill color of the shapes.

Parameters:
  • fill_args (tuple) – positional arguments to be parsed as a color.
  • fill_kwargs (dict) – keyword arguments to be parsed as a color.
Returns:

The fill color.

Return type:

Color

no_fill()

p5.no_fill()

Disable filling geometry.

stroke()

p5.stroke(*color_args, **color_kwargs)

Set the color used to draw lines around shapes

Parameters:
  • color_args (tuple) – positional arguments to be parsed as a color.
  • color_kwargs (dict) – keyword arguments to be parsed as a color.
Note:

Both color_args and color_kwargs are directly sent to Color.parse_color

Returns:

The stroke color.

Return type:

Color

no_stroke()

p5.no_stroke()

Disable drawing the stroke around shapes.

tint()

p5.tint(*color_args, **color_kwargs)

Set the tint color for the sketch.

Parameters:
  • color_args (tuple) – positional arguments to be parsed as a color.
  • color_kwargs (dict) – keyword arguments to be parsed as a color.
Note:

Both color_args and color_kwargs are directly sent to Color.parse_color

Returns:

The tint color.

Return type:

Color

no_tint()

p5.no_tint()

Disable tinting of images.

stroke_weight()

p5.stroke_weight(thickness)

Sets the width of the stroke used for lines, points, and the border around shapes. All widths are set in units of pixels.

Parameters:weight (int) – thickness of stroke in pixels

stroke_cap()

p5.stroke_cap(c)

Sets the style of line endings. The ends are SQUARE, PROJECT, and ROUND. The default cap is ROUND.

Parameters:c (string) – either ‘SQUARE’, ‘PROJECT’ or ‘ROUND’

stroke_join()

p5.stroke_join(j)

Sets the style of the joints which connect line segments. These joints are either mitered, beveled, or rounded and specified with the corresponding parameters MITER, BEVEL, and ROUND. The default joint is MITER.

Parameters:weight – either ‘MITER’, ‘BEVEL’ or ‘ROUND’