1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-03 11:50:27 +00:00

Merge pull request #111896 from Calinou/doc-image-set-pixel-format

Document color format caveats in `Image.set_pixel()`
This commit is contained in:
Rémi Verschelde
2025-11-01 19:05:28 +01:00

View File

@@ -584,6 +584,8 @@
[/csharp]
[/codeblocks]
This is the same as [method set_pixelv], but with a two integer arguments instead of a [Vector2i] argument.
[b]Note:[/b] Depending on the image's format, the color set here may be clamped or lose precision. Do not assume the color returned by [method get_pixel] to be identical to the one set here; any comparisons will likely need to use an approximation like [method Color.is_equal_approx].
[b]Note:[/b] On grayscale image formats, only the red channel of [param color] is used (and alpha if relevant). The green and blue channels are ignored.
</description>
</method>
<method name="set_pixelv">
@@ -609,6 +611,8 @@
[/csharp]
[/codeblocks]
This is the same as [method set_pixel], but with a [Vector2i] argument instead of two integer arguments.
[b]Note:[/b] Depending on the image's format, the color set here may be clamped or lose precision. Do not assume the color returned by [method get_pixelv] to be identical to the one set here; any comparisons will likely need to use an approximation like [method Color.is_equal_approx].
[b]Note:[/b] On grayscale image formats, only the red channel of [param color] is used (and alpha if relevant). The green and blue channels are ignored.
</description>
</method>
<method name="shrink_x2">