Material:setColor

Sets a color property for a Material. Different types of colors are supported for different lighting parameters. Colors default to (1.0, 1.0, 1.0, 1.0) and are gamma corrected.

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

Arguments

NameTypeDefaultDescription
colorTypeMaterialColor'diffuse'The type of color to set.
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


Material:setColor(colorType, hex)

Arguments

NameTypeDefaultDescription
colorTypeMaterialColor'diffuse'The type of color to set.
hexnumberA hexcode to use for the color (alpha is not supported).

Returns

Nothing


Material:setColor(hex)

Arguments

NameTypeDescription
hexnumberA hexcode to use for the color (alpha is not supported).

Returns

Nothing

See also