RGBA 颜色表示形式。
在整个 Unity 中,该结构用于传递颜色。
每个颜色分量都是 0 到 1 范围内的浮点值。
分量 (r,g,b) 定义 RGB 颜色空间中的颜色。Alpha 分量 (a)
定义透明度 - alpha 为 1 表示完全不透明,alpha 为 0 表示完全
透明。
black | 纯黑色。RGBA 为 (0, 0, 0, 1)。 |
blue | 纯蓝色。RGBA 为 (0, 0, 1, 1)。 |
clear | 完全透明。RGBA 为 (0, 0, 0, 0)。 |
cyan | 青色。RGBA 为 (0, 1, 1, 1)。 |
gray | 灰色。RGBA 为 (0.5, 0.5, 0.5, 1)。 |
green | 纯绿色。RGBA 为 (0, 1, 0, 1)。 |
grey | gray 的英式拼写。RGBA 为相同的 (0.5, 0.5, 0.5, 1)。 |
magenta | 洋红色。RGBA 为 (1, 0, 1, 1)。 |
red | 纯红色。RGBA 为 (1, 0, 0, 1)。 |
white | 纯白色。RGBA 为 (1, 1, 1, 1)。 |
yellow | 黄色。RGBA 为 (1, 0.92, 0.016, 1),但该颜色很好看! |
a | 颜色的 Alpha 分量(0 为透明,1 为不透明)。 |
b | 颜色的蓝色分量。 |
g | 颜色的绿色分量。 |
gamma | 应用了伽马曲线的颜色版本。 |
grayscale | 颜色的灰度值。(只读) |
linear | sRGB 颜色的线性值。 |
maxColorComponent | 返回最大颜色分量值:Max(r,g,b)。 |
r | 颜色的红色分量。 |
this[int] | 分别使用 [0]、[1]、[2]、[3] 访问 r、g、b、a 分量。 |
Color | 使用给定的 r、g、b、a 分量构造新 Color。 |
ToString | Returns a formatted string of this color. |
HSVToRGB | 用 HSV 输入创建 RGB 颜色。 |
Lerp | 在颜色 a 与 b 之间按 t 进行线性插值。 |
LerpUnclamped | 在颜色 a 与 b 之间按 t 进行线性插值。 |
RGBToHSV | 计算 RGB 输入颜色的色调、饱和度和值。 |
Color | 可在 Vector4 中隐式地来回转换颜色。 |
operator - | 将颜色 a 减去颜色 /b/。每个分量分别相减。 |
operator * | 将两个颜色相乘。每个分量分别相乘。 |
operator / | 将颜色 a 除以浮点 /b/。每个颜色分量分别缩放。 |
operator + | 将两个颜色相加。每个分量分别相加。 |
Vector4 | 可在 Vector4 中隐式地来回转换颜色。 |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.