Heightbar colors are randomized, not based on their PrimaryPart Color

ive been making heightbar gui, like from tower of hell.
and the colors are incorrect.
for an example, this blue stage should have blue background, not grey.
image

local replicatedStorage = game:GetService("ReplicatedStorage")

local tower = workspace:FindFirstChild("Tower")
if not tower then return end

function createSectionFrames(towerHeight)
	for _, child in pairs(script.Parent.Frame:GetChildren()) do
		if child:IsA("Frame") then
			child:Destroy()
		end
	end
	
	local reversedSections = {}
	for _ , section in pairs(tower:GetChildren()) do
		table.insert(reversedSections, 1, section)
	end
	
	for _, section in pairs(reversedSections) do
		local frame = Instance.new("Frame")
		frame.Size = UDim2.new(1, 0, section.Height.Value/towerHeight, 0)
		frame.Name = section.Name
		frame.BorderSizePixel = 0
		frame.BackgroundColor3 = section.PrimaryPart.Color -- this changes the background colour
		frame.Parent = script.Parent.Frame
	end
end

createSectionFrames(tonumber(replicatedStorage.TowerHeight.Value))

replicatedStorage.HeightEvent.OnClientEvent:Connect(function(towerHeight)
	createSectionFrames(tonumber(towerHeight))
end)

Is your PrimaryPart blue??

print(section.PrimaryPart)
Print your primary part. Click it in output. That will select the part in studio. What color is it?

You’ll also want to sort your table in order. :GetChildren() probably isn’t giving you the table in a good order.

Yes, the PrimaryParts are the correct colors, but instead it shows the wrong one, also, print shows me this.
image

Click on them and see what their colors are in the properties menu.

Maybe referring wrong property.
Also, unable to find between part+surface and decals and textures.

when i click this, it just redirects me back to my script.

Clicking the objects in the output should still select them in your Explorer and Properties window, even if it brings up the script.

when i try click on those things in the output, it only redirects me to 1 part, and this only part matches the colors (grey stage has grey background)