From 46ef52162eee2bdddb44a15fc8bf37aeb1aa3f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 13 Apr 2022 10:37:22 +0200 Subject: Color: Rename `to_srgb`/`to_linear` to include base color space This helps reduce confusion around sRGB <> Linear conversions by making both input and output color spaces explicit. --- doc/classes/Color.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'doc/classes') diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index 5b48804d9d..7b8a57ed22 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -183,7 +183,7 @@ 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. + [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 srgb_to_linear] to convert it to the linear color space first. @@ -321,6 +321,18 @@ [/codeblocks] + + + + 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 srgb_to_linear] which performs the opposite operation. + + + + + + Returns the color converted to the linear color space. This assumes the original color is in the sRGB color space. See also [method linear_to_srgb] which performs the opposite operation. + + @@ -405,12 +417,6 @@ [/codeblocks] - - - - 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. - - @@ -443,12 +449,6 @@ [/codeblocks] - - - - 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. - - -- cgit v1.2.3