summaryrefslogtreecommitdiff
path: root/doc/classes/Color.xml
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2021-11-04 10:58:20 -0500
committerAaron Franke <arnfranke@yahoo.com>2021-11-04 14:44:55 -0500
commit813466b3c893ce2d47098268475818d1e4e485b4 (patch)
treeb5f15a25d9680d88d08bb37f8afe67f5fc6fe3e9 /doc/classes/Color.xml
parentee939c919b14a1935a0b6ccde338846a14cb9744 (diff)
Add documentation to operators for math types
Co-authored-by: Raul Santos <raulsntos@gmail.com>
Diffstat (limited to 'doc/classes/Color.xml')
-rw-r--r--doc/classes/Color.xml15
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml
index 71ec225cf6..c2c63efa37 100644
--- a/doc/classes/Color.xml
+++ b/doc/classes/Color.xml
@@ -863,54 +863,64 @@
<return type="bool" />
<argument index="0" name="right" type="Color" />
<description>
+ Returns [code]true[/code] if the colors are not equal.
+ [b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
</description>
</operator>
<operator name="operator *">
<return type="Color" />
<argument index="0" name="right" type="Color" />
<description>
+ Multiplies each component of the [Color] by the components of the given [Color].
</description>
</operator>
<operator name="operator *">
<return type="Color" />
<argument index="0" name="right" type="float" />
<description>
+ Multiplies each component of the [Color] by the given [float].
</description>
</operator>
<operator name="operator *">
<return type="Color" />
<argument index="0" name="right" type="int" />
<description>
+ Multiplies each component of the [Color] by the given [int].
</description>
</operator>
<operator name="operator +">
<return type="Color" />
<argument index="0" name="right" type="Color" />
<description>
+ Adds each component of the [Color] with the components of the given [Color].
</description>
</operator>
<operator name="operator -">
<return type="Color" />
<argument index="0" name="right" type="Color" />
<description>
+ Subtracts each component of the [Color] by the components of the given [Color].
</description>
</operator>
<operator name="operator /">
<return type="Color" />
<argument index="0" name="right" type="Color" />
<description>
+ Divides each component of the [Color] by the components of the given [Color].
</description>
</operator>
<operator name="operator /">
<return type="Color" />
<argument index="0" name="right" type="float" />
<description>
+ Divides each component of the [Color] by the given [float].
</description>
</operator>
<operator name="operator /">
<return type="Color" />
<argument index="0" name="right" type="int" />
<description>
+ Divides each component of the [Color] by the given [int].
</description>
</operator>
<operator name="operator ==">
@@ -922,22 +932,27 @@
<return type="bool" />
<argument index="0" name="right" type="Color" />
<description>
+ Returns [code]true[/code] if the colors are exactly equal.
+ [b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
</description>
</operator>
<operator name="operator []">
<return type="float" />
<argument index="0" name="index" type="int" />
<description>
+ Access color components using their index. [code]c[0][/code] is equivalent to [code]c.r[/code], [code]c[1][/code] is equivalent to [code]c.g[/code], [code]c[2][/code] is equivalent to [code]c.b[/code], and [code]c[3][/code] is equivalent to [code]c.a[/code].
</description>
</operator>
<operator name="operator unary+">
<return type="Color" />
<description>
+ Returns the same value as if the [code]+[/code] was not there. Unary [code]+[/code] does nothing, but sometimes it can make your code more readable.
</description>
</operator>
<operator name="operator unary-">
<return type="Color" />
<description>
+ Inverts the given color. This is equivalent to [code]Color.WHITE - c[/code] or [code]Color(1 - c.r, 1 - c.g, 1 - c.b, 1 - c.a)[/code].
</description>
</operator>
</operators>