Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Color.operator +

static function operator +(a: Color, b: Color): Color;
static Color operator +(Color a, Color b);
static def operator +(a as Color, b as Color) as Color

Description

Adds two colors together. Each component is added separately.

// blue + red = magenta
var result : Color = Color.blue + Color.red;
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    public Color result = Color.blue + Color.red;
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	public result as Color = (Color.blue + Color.red)