Document Color constant differences in C#
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
Although [Color] may be used to store values of any encoding, the red ([member r]), green ([member g]), and blue ([member b]) properties of [Color] are expected by Godot to be encoded using the [url=https://en.wikipedia.org/wiki/SRGB#Transfer_function_(%22gamma%22)]nonlinear sRGB transfer function[/url] unless otherwise stated. This color encoding is used by many traditional art and web tools, making it easy to match colors between Godot and these tools. Godot uses [url=https://en.wikipedia.org/wiki/Rec._709]Rec. ITU-R BT.709[/url] color primaries, which are used by the sRGB standard.
|
||||
All physical simulation, such as lighting calculations, and colorimetry transformations, such as [method get_luminance], must be performed on linearly encoded values to produce correct results. When performing these calculations, convert [Color] to and from linear encoding using [method srgb_to_linear] and [method linear_to_srgb].
|
||||
[b]Note:[/b] In a boolean context, a Color will evaluate to [code]false[/code] if it is equal to [code]Color(0, 0, 0, 1)[/code] (opaque black). Otherwise, a Color will always evaluate to [code]true[/code].
|
||||
[b]Note:[/b] In C#, color constants are defined in the [code]Colors[/code] static class instead of [code skip-lint]Color[/code]. Additionally, named colors use [code]PascalCase[/code] syntax instead of [code]UPPER_SNAKE_CASE[/code]. For example, [code skip-lint]Color.ALICE_BLUE[/code] in GDScript is [code skip-lint]Colors.AliceBlue[/code] in C#.
|
||||
</description>
|
||||
<tutorials>
|
||||
<link title="2D GD Paint Demo">https://godotengine.org/asset-library/asset/2768</link>
|
||||
|
||||
Reference in New Issue
Block a user