Select your preferred scripting language. All code snippets will be displayed in this language.
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
CloseFor some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
CloseMultiplies two colors together. Each component is multiplied separately.
// white * gray = gray var grayColor: Color = Color.gray * Color.white;
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { public Color grayColor = Color.gray * Color.white; }
Multiplies color a
by the float b
. Each color component is scaled separately.
// gray * 2 = White var whiteColor: Color = Color.gray * 2;
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { public Color whiteColor = Color.gray * 2; }
Multiplies color a
by the float b
. Each color component is scaled separately.
// 2 * gray = White var whiteColor: Color = 2 * Color.gray;
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { public Color whiteColor = 2 * Color.gray; }