unity 中文API之Color顏色

Color 顏色

unity 中文API之Color顏色

Description 描述

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顏色空間內定義一個顏色。 Alpha組件(a) 定義透明度 — alpha 值是 1 是完全不透明,alpha 值是 0 是完全透明。

Static Variables 靜態變量

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

純黑。RGBA是(0, 0, 0, 1)。 blue Solid blue. RGBA is (0, 0, 1, 1).

純藍。RGBA是(0, 0, 1, 1)。 clear Completely transparent. RGBA is (0, 0, 0, 0).

完全透明的。RGBA是(0, 0, 0, 0)。 cyan Cyan. RGBA is (0, 1, 1, 1).

藍綠色。RGBA是(0, 1, 1, 1)。 gray Gray. RGBA is (0.5, 0.5, 0.5, 1).

灰色。RGBA 是(0.5, 0.5, 0.5, 1)。 green Solid green. RGBA is (0, 1, 0, 1).

純綠色。RGBA是(0, 1, 0, 1)。 grey English spelling for gray. RGBA is the same (0.5, 0.5, 0.5, 1).

英語稱作gray。RGBA與(0.5, 0.5, 0.5, 1)一樣。 magenta Magenta. RGBA is (1, 0, 1, 1).

品紅色。RGBA是(1, 0, 1, 1)。 red Solid red. RGBA is (1, 0, 0, 1).

純紅色。RGBA是(1, 0, 0, 1)。 white Solid white. RGBA is (1, 1, 1, 1).

純白色。RGBA是(1, 1, 1, 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),但是這個顏色看起來不是那麼完美!

Variables 變量

a Alpha component of the color.

顏色的透明通道組建。 b Blue component of the color.

顏色的藍組件。 g Green component of the color.

顏色的綠組件。 gamma A version of the color that has had the gamma curve applied.

顏色的版本,該版本應用了伽馬曲線。 grayscale The grayscale value of the color. (Read Only)

顏色的灰度值。(只讀) linear A version of the color that has had the inverse gamma curve applied.

sRGB顏色的線性值。 maxColorComponent Returns the maximum color component value: Max(r,g,b).

返回顏色組件最大值:Max(r,g,b)。 r Red component of the color.

顏色的紅色組件。 this[int] Access the r, g, b,a components using [0], [1], [2], [3] respectively.

使用 r, g, b,a組件,使用[0], [1], [2], [3]表示。

Constructors 構造器

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

構造一個新的顏色,使用指定r,g,b,a組件。

Public Functions 共有函數

ToString Returns a nicely formatted string of this color.

返回一個良好該顏色的格式化字符串。

Static Functions 靜態函數

HSVToRGB Creates an RGB colour from HSV input.

從HSV輸入創建一個RGB顏色。 Lerp Linearly interpolates between colors a and b by t.

顏色a和顏色b之間的線性差值t。 LerpUnclamped Linearly interpolates between colors a and b by t.

顏色a和b之間的線性差值t。 RGBToHSV Calculates the hue, saturation and value of an RGB input color.

計算色調,飽和度和輸入顏色的RGB值。

Operators 操作符

Color Colors can be implicitly converted to and from Vector4.

顏色可以被隱式轉換成四維向量。 operator - Subtracts color b from color a. Each component is subtracted separately.

顏色a減去顏色b。每個組件都分開相減。 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。每個顏色組件都分開除以該數值。 operator + Adds two colors together. Each component is added separately.

兩個顏色相加。每個組件分別相加 Vector4 Colors can be implicitly converted to and from Vector4.

顏色可以隱式轉換成四維向量。


分享到:


相關文章: