From 1b8301ae728cb3ad69db7463d32e5fe4af2f99ce Mon Sep 17 00:00:00 2001 From: Variable Date: Tue, 26 Nov 2024 16:33:14 +0500 Subject: [PATCH] fixed wrong color getting stored in array (similar fix to #1108.) --- src/Classes/ImageExtended.gd | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Classes/ImageExtended.gd b/src/Classes/ImageExtended.gd index c1fd655d687..b2eec58612e 100644 --- a/src/Classes/ImageExtended.gd +++ b/src/Classes/ImageExtended.gd @@ -80,7 +80,12 @@ func update_palette() -> void: palette.resize(current_palette.colors_max) palette.fill(TRANSPARENT) for i in current_palette.colors: - palette[i] = current_palette.colors[i].color + # Due to the decimal nature of the color values, some values get rounded off + # unintentionally. + # Even though the decimal values change, the HTML code remains the same after the change. + # So we're using this trick to convert the values back to how they are shown in + # the palette. + palette[i] = Color(current_palette.colors[i].color.to_html()) ## Displays the actual RGBA values of each pixel in the image from indexed mode.