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
Name | Type | Default | Description |
colorType | MaterialColor | 'diffuse' | The type of color to get. |
r | number | The red component of the color. | |
g | number | The green component of the color. | |
b | number | The blue component of the color. | |
a | number | 1.0 | The alpha component of the color. |
Returns
Nothing
Material:setColor(r, g, b, a)
Arguments
Name | Type | Default | Description |
r | number | The red component of the color. | |
g | number | The green component of the color. | |
b | number | The blue component of the color. | |
a | number | 1.0 | The alpha component of the color. |
Returns
Nothing
See also
MaterialColor
lovr.graphics.setColor
Material:getColor
Material