Unity3D圣典3.3版本-中文版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
Color 颜色
# Color 颜色 Struct 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](Color.r.html),[g](Color.g.html),[b](Color.b.html)) 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 是完全透明。 ### Variables**变量** * [r](Color.r.html) Red component of the color. 颜色中的红色组件。 * [g](Color.g.html) Green component of the color. 颜色中的绿色组件。 * [b](Color.b.html) Blue component of the color. 颜色中的蓝色组件。 * [a](Color.a.html) Alpha component of the color. 颜色中的 Alpha 组件。 * [grayscale](Color.grayscale.html) The grayscale value of the color (Read Only) 颜色的灰度值(只读) * [this [int index]](Color.Index_operator.html) Access the r, g, b,a components using [0], [1], [2], [3] respectively. 分别用[0],[1],[2],[3]访问 r,g,b,a 组件。 ### Constructors**构造器** * [Color](Color.Color.html) Constructs a new Color with given r,g,b,a components. 用给定的 r,g,b,a 组件构造一个新的颜色。 ### Functions**函数** * [ToString](Color.ToString.html) Returns a nicely formatted string of this color. 返回该颜色一个格式化好的字符串。 ### Class Variables**类变量** * [red](Color.red.html) Solid red. RGBA is (1, 0, 0, 1). 纯红色。 RGBA 是 (1, 0, 0, 1) 。 * [green](Color.green.html) Solid green. RGBA is (0, 1, 0, 1). 纯绿色。 RGBA 是 (0, 1, 0, 1)。 * [blue](Color.blue.html) Solid blue. RGBA is (0, 0, 1, 1). 纯蓝色。RGBA 是 (0, 1, 0, 1)。 * [white](Color.white.html) Solid white. RGBA is (1, 1, 1, 1). 纯白色。 RGBA 是 (1, 1, 1, 1) 。 * [black](Color.black.html) Solid black. RGBA is (0, 0, 0, 1). 纯黑色。RGBA 是 (0, 0, 0, 1) 。 * [yellow](Color.yellow.html) Yellow. RGBA is weird (1, 235/255, 4/255, 1), but the color is nice to look at! 黄色。 RGBA 是怪异的 (1, 235/255, 4/255, 1) , 但是颜色看起来漂亮! * [cyan](Color.cyan.html) Cyan. RGBA is (0, 1, 1, 1). 青色 。 RGBA 是 (0, 1, 1, 1)。 * [magenta](Color.magenta.html) Magenta. RGBA is (1, 0, 1, 1). 紫红色。 RGBA 是 (1, 0, 1, 1)。 * [gray](Color.gray.html) Gray. RGBA is (0.5, 0.5, 0.5, 1). 灰色。 RGBA 是 (0.5, 0.5, 0.5, 1) 。 * [grey](Color.grey.html) English spelling for gray. RGBA is the same (0.5, 0.5, 0.5, 1). 英语的另一个写法,grey=gray,灰色。 RGBA 是 (0.5, 0.5, 0.5, 1) 。 * [clear](Color.clear.html) Completely transparent. RGBA is (0, 0, 0, 0). 完全透明。RGBA 是 (0, 0, 0, 0) 。 ### Class Functions**类函数** * [operator +](Color.operator_add.html) Adds two colors together. Each component is added separately. 两个颜色相加,每个组件被分别相加。 * [operator -](Color.operator_subtract.html) Subtracts color b from color a. Each component is subtracted separately. 颜色 a 减去颜色 b,每个组件分别相减。 * [operator *](Color.operator_multiply.html) Multiplies two colors together. Each component is multiplied separately. 两个颜色相乘,每个组件分别相乘。 * [operator /](Color.operator_divide.html) Divides color a by the float b. Each color component is scaled separately. 颜色 a 除以浮点数 b,每个颜色组件分别相除。 * [Lerp](Color.Lerp.html) Interpolates between colors a and b by t. 通过 t 在颜色 a 和 b 之间插值。 * [operator Vector4](Color.operator_Vector4.html) Colors can be implicitly converted to and from [Vector4](../Vector4/Vector4.html). 颜色能被隐式转换到 [Vector4](../Vector4/Vector4.html),也能由 [Vector4](../Vector4/Vector4.html) 转回颜色。 * [operator Color](Color.operator_Color.html) Colors can be implicitly converted to and from [Vector4](../Vector4/Vector4.html). 颜色能被隐式转换到 [Vector4](../Vector4/Vector4.html),也能由 [Vector4](../Vector4/Vector4.html) 转回颜色。
da
2022年5月17日 17:56
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码