summaryrefslogtreecommitdiffstats
path: root/doc/classes/Color.xml
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-07-26 11:56:21 +0200
committerRémi Verschelde <rverschelde@gmail.com>2018-07-26 11:56:21 +0200
commit391e46830f4f08ddfc9104fc9182d6944f609635 (patch)
tree0cbe62dc1e099d23ea30449bc5ed1b8b411cb0c1 /doc/classes/Color.xml
parentfd16dd48cbf309e06384535b5169aec57b590307 (diff)
downloadredot-engine-391e46830f4f08ddfc9104fc9182d6944f609635.tar.gz
doc: Sync classref with current source
Fix various missing arguments in bindings.
Diffstat (limited to 'doc/classes/Color.xml')
-rw-r--r--doc/classes/Color.xml114
1 files changed, 57 insertions, 57 deletions
diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml
index f3b0b9baab..3d74bd7ab0 100644
--- a/doc/classes/Color.xml
+++ b/doc/classes/Color.xml
@@ -15,67 +15,67 @@
<method name="Color">
<return type="Color">
</return>
- <argument index="0" name="r" type="float">
- </argument>
- <argument index="1" name="g" type="float">
- </argument>
- <argument index="2" name="b" type="float">
- </argument>
- <argument index="3" name="a" type="float">
+ <argument index="0" name="from" type="String">
</argument>
<description>
- Constructs a color from an RGBA profile using values between 0 and 1 (float).
+ Constructs a color from an HTML hexadecimal color string in ARGB or RGB format. See also [method @GDScript.ColorN].
+ The following string formats are supported:
+ [code]"#ff00ff00"[/code] - ARGB format with '#'
+ [code]"ff00ff00"[/code] - ARGB format
+ [code]"#ff00ff"[/code] - RGB format with '#'
+ [code]"ff00ff"[/code] - RGB format
[codeblock]
- var c = Color(0.2, 1.0, .7, .8) # a color of an RGBA(51, 255, 178, 204)
+ # The following code creates the same color of an RGBA(178, 217, 10, 255)
+ var c1 = Color("#ffb2d90a") # ARGB format with '#'
+ var c2 = Color("ffb2d90a") # ARGB format
+ var c3 = Color("#b2d90a") # RGB format with '#'
+ var c4 = Color("b2d90a") # RGB format
[/codeblock]
</description>
</method>
<method name="Color">
<return type="Color">
</return>
- <argument index="0" name="r" type="float">
- </argument>
- <argument index="1" name="g" type="float">
- </argument>
- <argument index="2" name="b" type="float">
+ <argument index="0" name="from" type="int">
</argument>
<description>
- Constructs a color from an RGB profile using values between 0 and 1 (float). Alpha will always be 1.
+ Constructs a color from a 32-bit integer (each byte represents a component of the RGBA profile).
[codeblock]
- var c = Color(0.2, 1.0, .7) # a color of an RGBA(51, 255, 178, 255)
+ var c = Color(274) # a color of an RGBA(0, 0, 1, 18)
[/codeblock]
</description>
</method>
<method name="Color">
<return type="Color">
</return>
- <argument index="0" name="from" type="int">
+ <argument index="0" name="r" type="float">
+ </argument>
+ <argument index="1" name="g" type="float">
+ </argument>
+ <argument index="2" name="b" type="float">
</argument>
<description>
- Constructs a color from a 32-bit integer (each byte represents a component of the RGBA profile).
+ Constructs a color from an RGB profile using values between 0 and 1 (float). Alpha will always be 1.
[codeblock]
- var c = Color(274) # a color of an RGBA(0, 0, 1, 18)
+ var c = Color(0.2, 1.0, .7) # a color of an RGBA(51, 255, 178, 255)
[/codeblock]
</description>
</method>
<method name="Color">
<return type="Color">
</return>
- <argument index="0" name="from" type="String">
+ <argument index="0" name="r" type="float">
+ </argument>
+ <argument index="1" name="g" type="float">
+ </argument>
+ <argument index="2" name="b" type="float">
+ </argument>
+ <argument index="3" name="a" type="float">
</argument>
<description>
- Constructs a color from an HTML hexadecimal color string in ARGB or RGB format. See also [method @GDScript.ColorN].
- The following string formats are supported:
- [code]"#ff00ff00"[/code] - ARGB format with '#'
- [code]"ff00ff00"[/code] - ARGB format
- [code]"#ff00ff"[/code] - RGB format with '#'
- [code]"ff00ff"[/code] - RGB format
+ Constructs a color from an RGBA profile using values between 0 and 1 (float).
[codeblock]
- # The following code creates the same color of an RGBA(178, 217, 10, 255)
- var c1 = Color("#ffb2d90a") # ARGB format with '#'
- var c2 = Color("ffb2d90a") # ARGB format
- var c3 = Color("#b2d90a") # RGB format with '#'
- var c4 = Color("b2d90a") # RGB format
+ var c = Color(0.2, 1.0, .7, .8) # a color of an RGBA(51, 255, 178, 204)
[/codeblock]
</description>
</method>
@@ -187,73 +187,73 @@
[/codeblock]
</description>
</method>
- <method name="to_html">
- <return type="String">
+ <method name="to_abgr32">
+ <return type="int">
</return>
- <argument index="0" name="with_alpha" type="bool" default="True">
- </argument>
<description>
- Returns the color's HTML hexadecimal color string in ARGB format (ex: [code]ff34f822[/code]).
- Optionally flag 'false' to not include alpha in hexadecimal string.
+ Returns the color's 32-bit integer in ABGR format (each byte represents a component of the ABGR profile). ABGR is the reversed version of the default format.
[codeblock]
- var c = Color(1, 1, 1, .5)
- var s1 = c.to_html() # Results "7fffffff"
- var s2 = c.to_html(false) # Results 'ffffff'
+ var c = Color(1, .5, .2)
+ print(c.to_abgr32()) # Prints 4281565439
[/codeblock]
</description>
</method>
- <method name="to_argb32">
+ <method name="to_abgr64">
<return type="int">
</return>
<description>
- Returns the color's 32-bit integer in ARGB format (each byte represents a component of the ARGB profile). ARGB is more compatible with DirectX.
+ Returns the color's 64-bit integer in ABGR format (each word represents a component of the ABGR profile). ABGR is the reversed version of the default format.
[codeblock]
var c = Color(1, .5, .2)
- print(c.to_argb32()) # Prints 4294934323
+ print(c.to_abgr64()) # Prints -225178692812801
[/codeblock]
</description>
</method>
- <method name="to_abgr32">
+ <method name="to_argb32">
<return type="int">
</return>
<description>
- Returns the color's 32-bit integer in ABGR format (each byte represents a component of the ABGR profile). ABGR is the reversed version of the default format.
+ Returns the color's 32-bit integer in ARGB format (each byte represents a component of the ARGB profile). ARGB is more compatible with DirectX.
[codeblock]
var c = Color(1, .5, .2)
- print(c.to_abgr32()) # Prints 4281565439
+ print(c.to_argb32()) # Prints 4294934323
[/codeblock]
</description>
</method>
- <method name="to_rgba32">
+ <method name="to_argb64">
<return type="int">
</return>
<description>
- Returns the color's 32-bit integer in RGBA format (each byte represents a component of the RGBA profile). RGBA is the format that Godot uses by default.
+ Returns the color's 64-bit integer in ARGB format (each word represents a component of the ARGB profile). ARGB is more compatible with DirectX.
[codeblock]
var c = Color(1, .5, .2)
- print(c.to_rgba32()) # Prints 4286526463
+ print(c.to_argb64()) # Prints -2147470541
[/codeblock]
</description>
</method>
- <method name="to_argb64">
- <return type="int">
+ <method name="to_html">
+ <return type="String">
</return>
+ <argument index="0" name="with_alpha" type="bool" default="True">
+ </argument>
<description>
- Returns the color's 64-bit integer in ARGB format (each word represents a component of the ARGB profile). ARGB is more compatible with DirectX.
+ Returns the color's HTML hexadecimal color string in ARGB format (ex: [code]ff34f822[/code]).
+ Optionally flag 'false' to not include alpha in hexadecimal string.
[codeblock]
- var c = Color(1, .5, .2)
- print(c.to_argb64()) # Prints -2147470541
+ var c = Color(1, 1, 1, .5)
+ var s1 = c.to_html() # Results "7fffffff"
+ var s2 = c.to_html(false) # Results 'ffffff'
[/codeblock]
</description>
</method>
- <method name="to_abgr64">
+ <method name="to_rgba32">
<return type="int">
</return>
<description>
- Returns the color's 64-bit integer in ABGR format (each word represents a component of the ABGR profile). ABGR is the reversed version of the default format.
+ Returns the color's 32-bit integer in RGBA format (each byte represents a component of the RGBA profile). RGBA is the format that Godot uses by default.
[codeblock]
var c = Color(1, .5, .2)
- print(c.to_abgr64()) # Prints -225178692812801
+ print(c.to_rgba32()) # Prints 4286526463
[/codeblock]
</description>
</method>