Skip to content

Commit 1ea54ae

Browse files
committed
fix shadowed variables and remove more snakes
1 parent 5544836 commit 1ea54ae

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

plugin/src/App/Components/ClassIcon.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ local function getRecoloredClassIcon(className, color)
4747

4848
if iconProps and color then
4949
--stylua: ignore
50-
local success, editableImageSize, editableImagePixels = pcall(function(iconProps: { [any]: any }, color: Color3): (Vector2, buffer)
51-
local size, pixels = getImageSizeAndPixels(iconProps.Image)
50+
local success, editableImageSize, editableImagePixels = pcall(function(_iconProps: { [any]: any }, _color: Color3): (Vector2, buffer)
51+
local size, pixels = getImageSizeAndPixels(_iconProps.Image)
5252
local pixelsLen = buffer.len(pixels)
5353

5454
local minVal, maxVal = math.huge, -math.huge
@@ -67,19 +67,19 @@ local function getRecoloredClassIcon(className, color)
6767
maxVal = math.max(maxVal, pixelVal)
6868
end
6969

70-
local hue, sat, val = color:ToHSV()
70+
local hue, sat, val = _color:ToHSV()
7171

7272
for i = 0, pixelsLen, 4 do
7373
if buffer.readu8(pixels, i + 3) == 0 then
7474
continue
7575
end
76-
local g_index = i + 1
77-
local b_index = i + 2
76+
local gIndex = i + 1
77+
local bIndex = i + 2
7878

7979
local pixelVal = math.max(
8080
buffer.readu8(pixels, i),
81-
buffer.readu8(pixels, g_index),
82-
buffer.readu8(pixels, b_index)
81+
buffer.readu8(pixels, gIndex),
82+
buffer.readu8(pixels, bIndex)
8383
)
8484
local newVal = val
8585
if minVal < maxVal then
@@ -89,8 +89,8 @@ local function getRecoloredClassIcon(className, color)
8989

9090
local newPixelColor = Color3.fromHSV(hue, sat, newVal)
9191
buffer.writeu8(pixels, i, newPixelColor.R)
92-
buffer.writeu8(pixels, g_index, newPixelColor.G)
93-
buffer.writeu8(pixels, b_index, newPixelColor.B)
92+
buffer.writeu8(pixels, gIndex, newPixelColor.G)
93+
buffer.writeu8(pixels, bIndex, newPixelColor.B)
9494
end
9595
return size, pixels
9696
end, iconProps, color)

0 commit comments

Comments
 (0)