Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetColor

Get a color from the property block.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

GetColor(string)

Get a color from the property block.
public Color GetColor(string name)

Parameters

name

The name of the property.

Returns

Type

Description

Color

Remarks

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

GetColor(int)

Get a color from the property block.
public Color GetColor(int nameID)

Parameters

nameID

The name ID of the property retrieved by Shader.PropertyToID.

Returns

Type

Description

Color

Remarks

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