美文网首页
Unity Color 颜色(1)

Unity Color 颜色(1)

作者: Nmao | 来源:发表于2017-11-20 11:07 被阅读0次

Representation of RGBA colors.

用RGBA来表示颜色。

This structure is used throughout Unity to pass colors around. Each color component is a floating point value with a range from 0 to 1.

这个结构被用于整个unity中颜色的传递。每种颜色组件都是一个范围为0~1的浮点型的值。

Components (r,g,b) define a color in RGB color space. Alpha component (a) defines transparency - alpha of one is completely opaque, alpha of zero is completely transparent.

组件(r,g,b)定义一个在RGB颜色空间内的颜色。阿尔法组件(a)定义透明度--阿尔法为1时是完全不透明的,阿尔法为0时是完全透明。

于飞  unity

Color  颜色

Color  颜色

Variables  变量

r

Red红色

Red component of the color.

颜色中的红色组件。

g

Green 绿色

Green component of the color.

颜色中的绿色组件。

b

Blue 蓝色

Blue component of the color.

颜色中的蓝色组件。

a

Alpha 阿尔法

Alpha component of the color.

颜色中的Alpha(阿尔法)组件。

grayscale

灰度

The grayscale value of the color (Read Only)

颜色的灰度值(只读)。

this [int index]

访问索引

Access the r, g, b,a components using [0], [1], [2], [3] respectively.

使用[0],[1],[2],[3]分别访问r,g,b,a组件。

Constructors  构造函数

Color

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

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

Functions  函数

ToString

转换为字符串

Returns a nicely formatted string of this color.

返回这个颜色已经格式化完毕的字符串。

Class Variables  类变量

red

Solid red. RGBA is (1, 0, 0, 1).

纯红。RGBA为 (1, 0, 0, 1)。

green

绿

Solid green. RGBA is (0, 1, 0, 1).

纯绿。RGBA为(0, 1, 0, 1)。

blue

Solid blue. RGBA is (0, 0, 1, 1).

纯蓝。RGBA为(0, 0, 1, 1)。

white

Solid white. RGBA is (1, 1, 1, 1).

纯白。RGBA为(1, 1, 1, 1)。

black

Solid black. RGBA is (0, 0, 0, 1).

纯黑。RGBA为(0, 0, 0, 1)。

yellow

Yellow. RGBA is (1, 0.92, 0.016, 1), but the color is nice to look at!

黄色。RGBA为 (1, 0.92, 0.016, 1),但这种颜色看起来好(美)。

cyan

Cyan. RGBA is (0, 1, 1, 1).

青色。RGBA为(0, 1, 1, 1)。

magenta

Magenta. RGBA is (1, 0, 1, 1)

.紫色。RGBA为 (1, 0, 1, 1)。

gray

Gray. RGBA is (0.5, 0.5, 0.5, 1).

灰色。RGBA为(0.5, 0.5, 0.5, 1)。

grey

English spelling for gray. RGBA is the same (0.5, 0.5, 0.5, 1).

英语拼写gray(即geay=grey,灰) 。RGBA为(0.5, 0.5, 0.5, 1)。

clear

空(净)

Completely transparent. RGBA is (0, 0, 0, 0).

完全透明。RGBA为(0, 0, 0, 0)。

于飞  unity

Class Functions  类函数

operator +

运算符 加

Adds two colors together. Each component is added separately.

将两个颜色相加。每个组件被分别相加。

operator -

运算符 减

Subtracts color b from color a. Each component is subtracted separately.

将颜色b从颜色a中减去。每个组件被分别减去。

operator *

运算符 乘

Multiplies two colors together. Each component is multiplied separately.

两个颜色彼此相乘。每个组件被分别相乘

operator /

运算符 除

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

颜色a除以浮点b。每个亚瑟组件被分别相除

Lerp

插值

Interpolates between colors a and b by t.

通过t在颜色a和b之间插入值。

operator Vector4

运算符 四维向量

A version of the color that has had the inverse gamma curve applied

逆向gamma曲线应用的颜色版本。

operator Color

运算符 颜色

Colors can be implicitly converted to and from Vector4.

Colors可以隐式转换为Vector4,也可以从Vector4转化为Colors。

参考:http://blog.sina.com.cn/s/blog_8ccc25e50101ij5p.html

相关文章

网友评论

      本文标题:Unity Color 颜色(1)

      本文链接:https://www.haomeiwen.com/subject/nnzmvxtx.html