Talk:BrickColor Codes

From Legacy Roblox Wiki
Jump to navigationJump to search

Table Generation Code

Just in case you need to mass edit something. --Anaminus 21:56, 17 February 2011 (UTC)

Instructions:

  1. Insert Script
  2. Double-click script from Explorer
  3. Paste code
  4. Close script
  5. Run place
  6. Copy entire output
  7. Paste in preferred text editor
  8. Replace "\n" with newline character
  9. ???
  10. Profit

All Colors

local palette = {}
local s = ""
for i = 0, 63 do
	palette[BrickColor.palette(i).Number] = true
end
for i = 1, 1032 do
	local B = BrickColor.new(i)
	if B.Number == i then
		local color = ("#%02X%02X%02X"):format(
			math.floor(B.Color.r * 255),
			math.floor(B.Color.g * 255),
			math.floor(B.Color.b * 255)
		)
		local q = not palette[B.Number]
		s = s .. ('|-\\n|style="background:%s"| || %d || %s\\n'):format(
			color,
			B.Number,
			(q and "<s>" or "") .. B.Name .. (q and "</s>" or "")
		)
	end
end
for i = 1, 250 do print() end
print(s)

Palette Colors

local s = ""
for i=0,63 do
	local B = BrickColor.palette(i)
	local r = math.floor(B.Color.r*255)
	local g = math.floor(B.Color.g*255)
	local b = math.floor(B.Color.b*255)
	s=s.."|-\\n|style=\"background:rgb("..r..", "..g..", "..b..")"
	.."\"| ||"..B.Number.."||"
	..B.Name.."\\n"
end
for i=1,250 do print() end
print(s)