Translate numbers from 0 to 9 into color names
I try to write an exercise about resistor color code with random values. I would like to translate numbers from 0 to 9 into color names and vice versa, with LaTeX. I've checked the FP guide but I can't figure it out. Is there any way to convert with LaTeX something like:
Nice, I had seen xcolor but not ifthenelse!