Py5Graphics.specular()#

Sets the specular color of the materials used for shapes drawn to the Py5Graphics drawing surface, which sets the color of highlights.

Description#

Sets the specular color of the materials used for shapes drawn to the Py5Graphics drawing surface, which sets the color of highlights. Specular refers to light which bounces off a surface in a preferred direction (rather than bouncing in all directions like a diffuse light). Use in combination with Py5Graphics.emissive(), Py5Graphics.ambient(), and Py5Graphics.shininess() to set the material properties of shapes.

This method has additional color functionality that is not reflected in the method’s signatures. For example, you can pass the name of a color (e.g. “green”, “mediumpurple”, etc). Look at the online “All About Colors” Python Ecosystem Integration tutorial for more information.

This method is the same as specular() but linked to a Py5Graphics object. To see example code for how it can be used, see specular().

Underlying Processing method: PGraphics.specular

Signatures#

specular(
    gray: float,  # value between black and white, by default 0 to 255
    /,
) -> None

specular(
    rgb: int,  # color to set
    /,
) -> None

specular(
    v1: float,  # red or hue value (depending on current color mode)
    v2: float,  # green or saturation value (depending on current color mode)
    v3: float,  # blue or brightness value (depending on current color mode)
    /,
) -> None

Updated on December 25, 2023 16:36:33pm UTC