Weird coloring bug

Hi, I was teaching my friend how to code and he wrote this. Looks all good but when you run it the part will sometimes turn green and blue. The numbers are constant so they should be a shade of grey. I don’t see any reason why it is doing that.

local Part = script.Parent

for i = 1, 25 do
	Part.Size = Vector3.new(i,i,i)
	local o = i/25
	Part.BrickColor = BrickColor.new(o,o,o)
	print(BrickColor.new(o, o, o))
	wait(1)
end

That is his code btw, don’t criticize me :stuck_out_tongue:

There aren’t enough shades of grey to match, so it sometimes grabs a blue or green instead of grey.

Remember there’s only ~64 BrickColors. When a Color3 isn’t valid BrickColor it chooses the closest one. It turns green/blue because those are the closest available BrickColors to those Color3 values.