Material:setColor

Sets a color property for a Material. Different types of colors are supported for different lighting parameters. Color channels should be from 0.0 to 1.0. Colors default to white and are gamma corrected as necessary, see lovr.graphics.isGammaCorrect for more info on that.

Material:setColor(colorType, r, g, b, a)

Arguments

NameTypeDefaultDescription
colorTypeMaterialColor'diffuse'The type of color to get.
rnumberThe red component of the color.
gnumberThe green component of the color.
bnumberThe blue component of the color.
anumber1.0The alpha component of the color.

Returns

Nothing


Material:setColor(r, g, b, a)

Arguments

NameTypeDefaultDescription
rnumberThe red component of the color.
gnumberThe green component of the color.
bnumberThe blue component of the color.
anumber1.0The alpha component of the color.

Returns

Nothing

See also