vacha
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 1993 |
|
|
| 28 May 2015 10:03 PM |
Is there any way to get all the available brick color values from a script?
while true do the do |
|
|
| Report Abuse |
|
|
| |
|
jewelycat
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 17345 |
|
|
| 28 May 2015 10:15 PM |
I feel like there should be a better way, but this technically works: bc = {BrickColor.new("Medium stone grey")} for i=1,1032 do local c = BrickColor.new(i) if (c ~= bc[1]) then bc[#bc+1] =c end end
for i=1,#bc do print(bc[i]) end print(#bc) --> 144 colors
|
|
|
| Report Abuse |
|
|
vacha
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 1993 |
|
|
| 28 May 2015 10:17 PM |
Nice!! Thanks!!
while true do the do |
|
|
| Report Abuse |
|
|
jewelycat
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 17345 |
|
|
| 28 May 2015 10:17 PM |
Also, if you're interested:
http://wiki.roblox.com/index.php?title=BrickColor_Codes |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 28 May 2015 10:18 PM |
| BrickColor.palette to be efficient. |
|
|
| Report Abuse |
|
|
|
| 28 May 2015 11:23 PM |
256^3 Color3.new (r,g,b) where r,g,b are integers [0,256) has 256^3 permutations.
in hexadecimal the range goes from 0x0 to 0xFFFFFF, so there are FFFFFF base 16 colors |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 28 May 2015 11:25 PM |
| Yeah let's just be inefficient and let Roblox 'convert' it to the nearest BrickColor |
|
|
| Report Abuse |
|
|
|
| 28 May 2015 11:36 PM |
part=Instance.new ("Part") part.Anchored=true part.Parent=game.Workspace part.CFrame=CFrame.new (0,2,0)
step=1 --the speed of color change while true do for b=0,255,step do for g=0,255,step do for r=0,255,step do part.Color=Color3.new(r,g,b) wait () end end end print ("A color cycle has finished. Repeating") wait (1) end
--This script will display every possible color value. It might take awhile. |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 28 May 2015 11:49 PM |
local colors={} for r=1,255 do for g=1,255 do for b=1,255 do table.insert(colors,Color3.new(r,g,b)) end end end |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 28 May 2015 11:52 PM |
| Why are you guys even bothering, the question has already been answered giving the appropriate solution. |
|
|
| Report Abuse |
|
|
|
| 28 May 2015 11:53 PM |
naw that won't work
because
once the r loop is done, it'll start adding to the g loop, so it will be 255,g,b
so not all of the Color3
like this
local Color3s = {r={},g={},b={}}
coroutine.wrap(function() for i = 0,255 do wait() table.insert(Color3s.r,i,i) end end) coroutine.wrap(function() for i = 0,255 do wait() table.insert(Color3s.g,i,i) end end) coroutine.wrap(function() for i = 0,255 do wait() table.insert(Color3s.b,i,i) end end)
but this is really ineffecient |
|
|
| Report Abuse |
|
|