RE: Getting Color *names* as strings?
- To: mathgroup at smc.vnet.net
- Subject: [mg67498] RE: [mg67473] Getting Color *names* as strings?
- From: "David Park" <djmp at earthlink.net>
- Date: Wed, 28 Jun 2006 03:52:27 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Needs["Graphics`Colors`"] HoldForm[{CinnabarGreen, ChromeOxideGreen, CobaltGreen}] greens = Map[HoldForm, %, {2}] // ReleaseHold Do[Plot[k*x, {x, 1, 2}, PlotStyle :> ReleaseHold[greens[[k]]], PlotLabel -> greens[[k]]], {k, 1, Length[greens]}] David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: AES [mailto:siegman at stanford.edu] To: mathgroup at smc.vnet.net Trying out different named Colors in a plot by using greens={CinnabarGreen, ChromeOxideGreen, CobaltGreen, etc}; Do[ Plot[ func, range, PlotStyle -> greens[[k]], PlotLabel -> ToString[greens[[k]]] ] , {k, 1, Length[greens]} ]; Works fine -- except the PlotLabel comes out as "RGB[num, num, num]" -- and using SymbolName[greens[[1]]] or even SymbolName[CinnabarGreen] does _not_ give the string "CinnabarGreen". How can I get the *name* of each color as a string to put in PlotLabel or in a Text label? (Trivial problem, I agree, but just frustrating enough to be interesting)