Skip to content

SpriteRenderer Extensions

Andrzej Kebab edited this page Feb 2, 2024 · 2 revisions

UtilityLibrary.Unity.Runtime

Color Control

SetColorA

Sets the alpha component of the color of the SpriteRenderer.

spriteRenderer.SetColorA(0.5f);

Parameters:

  • {float} alpha: The alpha component of the color.

SetColorR

Sets the red component of the color of the SpriteRenderer.

spriteRenderer.SetColorR(1.0f);

Parameters:

  • {float} red: The red component of the color.

SetColorG

Sets the green component of the color of the SpriteRenderer.

spriteRenderer.SetColorG(0.8f);

Parameters:

  • {float} green: The green component of the color.

SetColorB

Sets the blue component of the color of the SpriteRenderer.

spriteRenderer.SetColorB(0.2f);

Parameters:

  • {float} blue: The blue component of the color.

Clone this wiki locally