Well, first off your syntax for defining literal dictionaries is incorrect. Dictionaries are surrounded by curly brackets like this: {}
instead of square brackets like this: []
If you want 'Standard_Animator'
and 'Extended_Animator'
to be keys for lists of colors, you would want to do something like this:
legenddict = {"Standard_Animator" : ["blue", 3f7fff, 00bfff, 3fffbf, "green", bfff3f, ffbf00, ff7f00, "red"],
"Extended_Animator" : ["lightgray", "blue", 3f7fff, 00bfff, 3fffbf, "green", bfff3f, ffbf00, ff7f00, "red", "magenta"}
colordict = {'blue':'ff00ff', 'red':'808080', 'lightgray':'d3d3d3', 'magenta':'00ff00'}
So, to print the values in legenddict using the color names in colordict, you can check to see if the colors are keys in colordict, and if so, look up the values:
for color in legenddict['Standard_Animator']:
if color in colordict:
print colordict[color]
else:
print color
for color in legenddict['Extended_Animator']:
if color in colordict:
print colordict[color]
else:
print color