|
4 | 4 | Color in RGBA format using floats on the range of 0 to 1. |
5 | 5 | </brief_description> |
6 | 6 | <description> |
7 | | - A color represented by red, green, blue, and alpha (RGBA) components. The alpha component is often used for transparency. Values are in floating-point and usually range from 0 to 1. Some properties (such as CanvasItem.modulate) may accept values greater than 1 (overbright or HDR colors). |
| 7 | + A color represented by red, green, blue, and alpha (RGBA) components. The alpha component is often used for opacity. Values are in floating-point and usually range from 0 to 1. Some properties (such as CanvasItem.modulate) may accept values greater than 1 (overbright or HDR colors). |
8 | 8 | You can also create a color from standardized color names by using the string constructor or directly using the color constants defined here. The standardized color set is based on the [url=https://en.wikipedia.org/wiki/X11_color_names]X11 color names[/url]. |
9 | 9 | If you want to supply values in a range of 0 to 255, you should use [method @GDScript.Color8]. |
10 | 10 | [b]Note:[/b] In a boolean context, a Color will evaluate to [code]false[/code] if it's equal to [code]Color(0, 0, 0, 1)[/code] (opaque black). Otherwise, a Color will always evaluate to [code]true[/code]. |
|
30 | 30 | Constructs a [Color] from an existing color, but with a custom alpha value. |
31 | 31 | [codeblocks] |
32 | 32 | [gdscript] |
33 | | - var red = Color(Color.red, 0.5) # 50% transparent red. |
| 33 | + var red = Color(Color.red, 0.2) # 20% opaque red. |
34 | 34 | [/gdscript] |
35 | 35 | [csharp] |
36 | | - var red = new Color(Colors.Red, 0.5f); // 50% transparent red. |
| 36 | + var red = new Color(Colors.Red, 0.2f); // 20% opaque red. |
37 | 37 | [/csharp] |
38 | 38 | [/codeblocks] |
39 | 39 | </description> |
|
405 | 405 | </methods> |
406 | 406 | <members> |
407 | 407 | <member name="a" type="float" setter="" getter="" default="1.0"> |
408 | | - The color's alpha (transparency) component, typically on the range of 0 to 1. |
| 408 | + The color's alpha component, typically on the range of 0 to 1. A value of 0 means that the color is fully transparent. A value of 1 means that the color is fully opaque. |
409 | 409 | </member> |
410 | 410 | <member name="a8" type="int" setter="" getter="" default="255"> |
411 | 411 | Wrapper for [member a] that uses the range 0 to 255 instead of 0 to 1. |
|
0 commit comments