Unity Color 顏色(1)

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.

這個結(jié)構(gòu)被用于整個unity中顏色的傳遞。每種顏色組件都是一個范圍為0~1的浮點(diǎn)型的值。

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顏色空間內(nèi)的顏色。阿爾法組件(a)定義透明度--阿爾法為1時是完全不透明的,阿爾法為0時是完全透明。

于飛? unity

Color? 顏色

Color? 顏色

Variables? 變量

r

Red紅色

Red component of the color.

顏色中的紅色組件。

g

Green 綠色

Green component of the color.

顏色中的綠色組件。

b

Blue 藍(lán)色

Blue component of the color.

顏色中的藍(lán)色組件。

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? 構(gòu)造函數(shù)

Color

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

使用給定的r, g, b, a組件,構(gòu)造一個新的顏色。

Functions? 函數(shù)

ToString

轉(zhuǎn)換為字符串

Returns a nicely formatted string of this color.

返回這個顏色已經(jīng)格式化完畢的字符串。

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

藍(lán)

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

純藍(lán)。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? 類函數(shù)

operator +

運(yùn)算符 加

Adds two colors together. Each component is added separately.

將兩個顏色相加。每個組件被分別相加。

operator -

運(yùn)算符 減

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

將顏色b從顏色a中減去。每個組件被分別減去。

operator *

運(yùn)算符 乘

Multiplies two colors together. Each component is multiplied separately.

兩個顏色彼此相乘。每個組件被分別相乘

operator /

運(yùn)算符 除

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

顏色a除以浮點(diǎn)b。每個亞瑟組件被分別相除

Lerp

插值

Interpolates between colors a and b by t.

通過t在顏色a和b之間插入值。

operator Vector4

運(yùn)算符 四維向量

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

逆向gamma曲線應(yīng)用的顏色版本。

operator Color

運(yùn)算符 顏色

Colors can be implicitly converted to and from Vector4.

Colors可以隱式轉(zhuǎn)換為Vector4,也可以從Vector4轉(zhuǎn)化為Colors。


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

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容