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:
- Insert Script
- Double-click script from Explorer
- Paste code
- Close script
- Run place
- Copy entire output
- Paste in preferred text editor
- Replace "\n" with newline character
- ???
- 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)