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.grayscale

var grayscale: float;
float grayscale;
grayscale as float

Description

The grayscale value of the color. (Read Only)

var color : Color = Color (.3, .4, .6);
print(color.grayscale);
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    public Color color = new Color(0.3F, 0.4F, 0.6F);
    void Example() {
        print(color.grayscale);
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	public color as Color = Color(0.3F, 0.4F, 0.6F)

	def Example() as void:
		print(color.grayscale)