Color.Color 颜色

static function Color (r : float, g : float, b : float, a : float) : Color

Description描述

Constructs a new Color with given r,g,b,a components.

用给定的r,g,b,a组件构造一个新的颜色。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public Color color = new Color(0.2F, 0.3F, 0.4F, 0.5F);
}
var color : Color = Color(0.2, 0.3, 0.4, 0.5);

• static function Color (r : float, g : float, b : float) : Color

Description描述

Constructs a new Color with given r,g,b components and sets a to 1.

用给定的r,g,b组件构造一个新的颜色并默认设置a的值是1。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public Color color = new Color(0.2F, 0.3F, 0.4F);
}
var color : Color = Color(0.2, 0.3, 0.4);
Page last updated: 2010-12-16