Skip to content

Commit 24bfea7

Browse files
authored
[Reviewed] [Recolorizer] Avoid to process transparent pixels (#1005)
1 parent c371b50 commit 24bfea7

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

extensions/reviewed/Recolorizer.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"name": "Recolorizer",
99
"previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Graphic Design/Graphic Design_color_colour_palette_paint_brush.svg",
1010
"shortDescription": "Independently change the colors of a sprite, a tiled sprite or a panel sprite.",
11-
"version": "0.1.2",
11+
"version": "0.1.3",
1212
"description": [
1313
"This extension allows to restyle a sprite, a tiled sprite or a panel sprite.",
1414
"",
@@ -205,6 +205,10 @@
205205
" const hueIsConstrained = hueScope < 0.5;",
206206
"",
207207
" for (let i = 0; i < sourcePixels.length; i += 4) {",
208+
" const alpha = sourcePixels[i + 3];",
209+
" if (alpha === 0) {",
210+
" continue;",
211+
" }",
208212
" const pixelHsl = rgbToHsl(sourcePixels[i + 0], sourcePixels[i + 1], sourcePixels[i + 2]);",
209213
"",
210214
" const pixelHue = pixelHsl[0];",
@@ -734,8 +738,7 @@
734738
"textG": 0,
735739
"textR": 0
736740
},
737-
"comment": "Unsure that destroyed instance recolorization can be free.",
738-
"comment2": ""
741+
"comment": "Unsure that destroyed instance recolorization can be free."
739742
},
740743
{
741744
"type": "BuiltinCommonInstructions::Standard",
@@ -1005,8 +1008,7 @@
10051008
"textG": 0,
10061009
"textR": 0
10071010
},
1008-
"comment": "Unsure that destroyed instance recolorization can be free.",
1009-
"comment2": ""
1011+
"comment": "Unsure that destroyed instance recolorization can be free."
10101012
},
10111013
{
10121014
"type": "BuiltinCommonInstructions::Standard",
@@ -1285,8 +1287,7 @@
12851287
"textG": 0,
12861288
"textR": 0
12871289
},
1288-
"comment": "Unsure that destroyed instance recolorization can be free.",
1289-
"comment2": ""
1290+
"comment": "Unsure that destroyed instance recolorization can be free."
12901291
},
12911292
{
12921293
"type": "BuiltinCommonInstructions::Standard",

0 commit comments

Comments
 (0)