Help with Table Question

I can never seem to figure this out. I have a table like such

[lua]local colors = {};
local colorName = ‘black’;
local color = ‘000000’;
colors[colorName] = tostring(color);[/lua]

but later, if I do
colors[colorName] I would expect ‘000000’ to be the response, but it’s not, it’s ‘black’. How can I get it to be ‘000000’ only knowing the name?

I know I this works:

colors[colorName] = {color=tostring(color)};
print(colors[colorName].color) – would print 000000 [import]uid: 19193 topic_id: 18691 reply_id: 318691[/import]

colors[colorName] should return “000000”. You probably made a mistake somewhere.
iterate through the colors table to see its contents
something like
[lua]for k,v in pairs(colors) do
print(k,v)
end[/lua] [import]uid: 64174 topic_id: 18691 reply_id: 71839[/import]