# Importing colors from file

I just tried something straightforward (for me):

dummy = Import["http://pastebin.com/raw.php?i=g8D7NprC", "List"] & /@ col;
colors = dummy[[1]];
ToExpression@colors;
Graphics[{colors, Rectangle[{0, 0}]}]


Is it not possible to import color data from a file?

-
it works fine if you remove & /@ col at the end of the first line. – kglr Jun 3 '14 at 20:10
Ok I don't know much but now there is nothing happening. No output at all. Which is very weird when it works fine with you. It states "RGBColor[0, 0, 1] is not a Graphics primitive or directive" – user3683367 Jun 3 '14 at 20:17
I think it is because your colors is a string; to change it to a color directive use ToExpression@colors... – kglr Jun 3 '14 at 20:25
Or just color = << "http://pastebin.com/raw.php?i=GXbeGrcD". – Rahul Jun 3 '14 at 20:25
@user3683367 - you oversimplified your question. what does your file to be imported REALLY look like? does it contain DIFFERENT colors, a list of colors ? But even in this case: How, exactly, do you want to color ONE rectangle with these different colors? – eldo Jun 3 '14 at 20:40

 dummy = Import["http://pastebin.com/raw.php?i=g8D7NprC", "List"];

@user3683367, you probably will be using this in an animation similar to the linked question; so i would recommend using the same setup... that is, {colors[[t]],Rectangle @@ (rectCoords[[t]])} with t the index you use in Animate or Table... – kglr Jun 3 '14 at 21:52