Skip to content

Commit 91b97da

Browse files
authored
Merge pull request #56214 from timothyqiu/alpha-channel
Alpha channel indicates opacity, not transparency
2 parents 9f05867 + 3ec5a5f commit 91b97da

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

doc/classes/Color.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Color in RGBA format using floats on the range of 0 to 1.
55
</brief_description>
66
<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).
88
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].
99
If you want to supply values in a range of 0 to 255, you should use [method @GDScript.Color8].
1010
[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,10 +30,10 @@
3030
Constructs a [Color] from an existing color, but with a custom alpha value.
3131
[codeblocks]
3232
[gdscript]
33-
var red = Color(Color.red, 0.5) # 50% transparent red.
33+
var red = Color(Color.red, 0.2) # 20% opaque red.
3434
[/gdscript]
3535
[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.
3737
[/csharp]
3838
[/codeblocks]
3939
</description>
@@ -405,7 +405,7 @@
405405
</methods>
406406
<members>
407407
<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.
409409
</member>
410410
<member name="a8" type="int" setter="" getter="" default="255">
411411
Wrapper for [member a] that uses the range 0 to 255 instead of 0 to 1.

doc/classes/ColorPicker.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
If [code]true[/code], the color will apply only after the user releases the mouse button, otherwise it will apply immediately even in mouse motion event (which can cause performance issues).
4242
</member>
4343
<member name="edit_alpha" type="bool" setter="set_edit_alpha" getter="is_editing_alpha" default="true">
44-
If [code]true[/code], shows an alpha channel slider (transparency).
44+
If [code]true[/code], shows an alpha channel slider (opacity).
4545
</member>
4646
<member name="hsv_mode" type="bool" setter="set_hsv_mode" getter="is_hsv_mode" default="false">
4747
If [code]true[/code], allows editing the color with Hue/Saturation/Value sliders.

0 commit comments

Comments
 (0)