Manual     Reference     Scripting  
  
Scripting > Runtime Classes > Color   
  • Menu
  • Overview
  • Runtime Classes
  • Attributes
  • Enumerations
  • Editor Classes
  • Enumerations
  • History
  • Index
  • Color
  • All Members
  • Variables
  • a
  • b
  • g
  • grayscale
  • r
  • this [int index]
  • Constructors
  • Color
  • Functions
  • ToString
  • Class Variables
  • black
  • blue
  • clear
  • cyan
  • gray
  • green
  • grey
  • magenta
  • red
  • white
  • yellow
  • Class Functions
  • Lerp
  • operator *
  • operator +
  • operator -
  • operator /
  • operator Color
  • operator Vector4

Color.operator *  

static operator * (a : Color, b : Color) : Color

Description

Multiplies two colors together. Each component is multiplied separately.

JavaScripts
// white * gray = gray
var grayColor: Color = Color.gray * Color.white;

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
public Color grayColor = Color.gray * Color.white;
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

public grayColor as Color = (Color.gray * Color.white)

static operator * (a : Color, b : float) : Color

Description

Multiplies color a by the float b. Each color component is scaled separately.

JavaScripts
// gray * 2 = White
var whiteColor: Color = Color.gray * 2;

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
public Color whiteColor = Color.gray * 2;
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

public whiteColor as Color = (Color.gray * 2)

static operator * (b : float, a : Color) : Color

Description

Multiplies color a by the float b. Each color component is scaled separately.

JavaScripts
// 2 * gray = White
var whiteColor: Color = 2 * Color.gray;

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
public Color whiteColor = 2 * Color.gray;
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

public whiteColor as Color = (2 * Color.gray)