summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2022-03-24 01:24:00 +0100
committerRĂ©mi Verschelde <remi@verschelde.fr>2022-03-28 12:17:55 +0200
commit1c343cd54d9bdb684de2e793f2ab99bfe85ae0d2 (patch)
tree6bb1510705f71241ee2e7fcf1285979193edb3d3 /doc/classes
parent01f34495bf261a64a790e6f71a14a445fc3f474c (diff)
Expose Color's `to_linear()` and `to_srgb()` to scripting
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/Color.xml13
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml
index e30d448a27..5b48804d9d 100644
--- a/doc/classes/Color.xml
+++ b/doc/classes/Color.xml
@@ -183,6 +183,7 @@
<description>
Returns the luminance of the color in the [code][0.0, 1.0][/code] range.
This is useful when determining light or dark color. Colors with a luminance smaller than 0.5 can be generally considered dark.
+ [b]Note:[/b] [method get_luminance] relies on the colour being in the linear color space to return an accurate relative luminance value. If the color is in the sRGB color space, use [method to_linear] to convert it to the linear color space first.
</description>
</method>
<method name="get_named_color" qualifiers="static">
@@ -404,6 +405,12 @@
[/codeblocks]
</description>
</method>
+ <method name="to_linear" qualifiers="const">
+ <return type="Color" />
+ <description>
+ Returns the color converted to the linear color space. This assumes the original color is in the sRGB color space. See also [method to_srgb] which performs the opposite operation.
+ </description>
+ </method>
<method name="to_rgba32" qualifiers="const">
<return type="int" />
<description>
@@ -436,6 +443,12 @@
[/codeblocks]
</description>
</method>
+ <method name="to_srgb" qualifiers="const">
+ <return type="Color" />
+ <description>
+ Returns the color converted to the [url=https://en.wikipedia.org/wiki/SRGB]sRGB[/url] color space. This assumes the original color is in the linear color space. See also [method to_linear] which performs the opposite operation.
+ </description>
+ </method>
</methods>
<members>
<member name="a" type="float" setter="" getter="" default="1.0">