Skip to content

Api > MaterialPropertyBlock > SetColor()


MaterialPropertyBlock.SetColor(string name, Color value)⚓︎

Set a color property.

Parameters:⚓︎

Name Type Description
name string The name of the property.
value Color The Color value to set.

Usage⚓︎

---@type MaterialPropertyBlock
local materialpropertyblock;

---@type string
local name;

---@type Color
local value;


materialpropertyblock.SetColor(name, value)

Extra Detail⚓︎

Adds a property to the block. If a color property with the given name already exists, the old value is replaced. The color value is considered to be always set in sRGB space and is converted to linear if the active color space is linear. You need manual updating of the color value if you switch between color spaces.