local function t(t,n)if not t.Palette then t.Palette={}end local a=n.Data local E=a:ReadAllBytes()if#E%3~=0 then error("\080\078\071 - \073\110\118\097\108\105\100 \080\076\084\069 \099\104\117\110\107\046")end for n=1,#E,3 do local a=E[n]local I=E[n+1]local O=E[n+2]local C=Color3.fromRGB(a,I,O)local A=#t.Palette+1 t.Palette[A]=C end end return t
local function PLTE(file, chunk)
	if not file.Palette then
		file.Palette = {}
	end
	
	local data = chunk.Data
	local palette = data:ReadAllBytes()
	
	if #palette % 3 ~= 0 then
		error("PNG - Invalid PLTE chunk.")
	end
	
	for i = 1, #palette, 3 do
		local r = palette[i]
		local g = palette[i + 1]
		local b = palette[i + 2]
		
		local color = Color3.fromRGB(r, g, b)
		local index = #file.Palette + 1
		
		file.Palette[index] = color
	end
end

return PLTE