MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Color names and the 10 elementary colors?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67528] Color names and the 10 elementary colors?
  • From: AES <siegman at stanford.edu>
  • Date: Fri, 30 Jun 2006 04:13:47 -0400 (EDT)
  • Organization: Stanford University
  • Sender: owner-wri-mathgroup at wolfram.com

When I recently inquired about using the names of Mathematica colors 
("CinnabarGreen", etc.) as label strings in a series of test plots, 
several responses proposed that I needed to manually input the names in 
quotes.  Brian Higgins suggested, however, a terse but somewhat arcane 
way to get color names as strings together with the corresponding RGB 
values with the Input line

   allColorNames =
       ({#1, ToColor[ ToExpression[#1], RGBColor]}&) /@ AllColors;

so that the Input

   allColorNames[[4]]

produces the Output

   { Apricot, RGBColor[1., 0.340007, 0.129994] }

(although his Output showed quotes around "Apricot" and mine doesn't.)

Since my objective was to test all varieties of Green, I added to this a 
more crudely programmed statement to generate a list of all the green 
color names and color values, viz.

   allGreens={ };
   Do[
    If[ StringMatchQ[ allColorNames[[k,1]], "*Green*" ],
      AppendTo[ allGreens, allColorNames[[k]] ] ], 
       {k, 1, Length[ allColorNames ]} ];

This works fine -- until you notice that just plain "Green" itself is 
not in the resulting list.  In fact, Green (along with Red, Blue, Brown, 
Orange, and 4 or 5 other "elementary colors") is not in AllColors.

I believe in earlier versions of Mathematica one had to use Graphics`Colors` to 
access even these elementary colors, and so they were presumably once 
included in AllColors (?); and I think I've learned somewhere that 10 or 
so of these elementary colors are now included within "plain 
Mathematica" and no long require calling the Graphics`Colors` package.  
But:

1)  I'd sure like to understand the logic of not continuing to use these 
colors in AllColors nonetheless.  Removing them seems a confusing and 
less than helpful choice to me at any rate.  And,

2)  Where -- or more important, how -- can the nonexpert user get at the 
list of these elementary colors?  

As a challenge, try invoking online Help on "Color" or "Colors" or any 
one of the elementary color names, and see if, using no more than 5 
subsequent mouse clicks within the Help screen, no typing,  and no 
pre-existing expert knowledge, just "common sense", you can find your 
way to the list of those colors.


  • Prev by Date: Re: Change Symbol in ListPlot
  • Next by Date: Re: Packages--Problem in evaluating functions from my own package!!!
  • Previous by thread: Recognizing newline character in regular expressions