Skip to content

Api > MaterialPropertyBlock > GetColor()


MaterialPropertyBlock.GetColor(string name)⚓︎

Get a color from the property block.

Parameters:⚓︎

Name Type Description
name string The name of the property.

Returns:⚓︎

type Description
Color color from the property block.

Usage⚓︎

---@type MaterialPropertyBlock
local materialpropertyblock;

---@type string
local name;


local val0 = materialpropertyblock.GetColor(name)

Extra Detail⚓︎

Returns (0, 0, 0, 0) if not found. If the value is previously set using SetColor, the returned value is converted from the currently active color space back to the sRGB color space.