MathGroup Archive 2004

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

Search the Archive

Re: colored alphabet for string output


Hi,

Information[ToColor]

show the usage message for it. It is in Mathematica since
version 4.0 but nobody add it to the help notebooks.

Regards
  Jens

Mike wrote:
> 
> I was unaware of ToColor. How did you find out about it?
> 
> I searched the online help guide and the only "hit" was for warning messages
> ToColor::
> 
> I guess this must be an undocumented function???
> 
> Mike
> 
> V5.0.1 on Mac OS X 10.3.3
> 
> On 18/5/04 6:22 PM, in article c8ch4c$emp$1 at smc.vnet.net, "Jens-Peer Kuska"
> <kuska at informatik.uni-leipzig.de> wrote:
> 
> > Hi,
> >
> > myList = {"abcdefg", "hijklmn", "prstuv"};
> >
> > randomColor[] := ToColor[Hue[Random[]], RGBColor];
> > colorString[str_String] := Module[{ss},
> >   ss = Characters[str];
> >   RowBox[StyleForm[#, FontColor -> randomColor[]] & /@ ss]
> >   ]
> >
> > colorString /@ myList // DisplayForm
> >
> > Regards
> > Jens
> >
> > Curt Fischer wrote:
> >>
> >> Dear Group:
> >>
> >> I have a long list of alphabetic strings.  I would like to ouput this list,
> >> with each of the letters of the string colored differently.  How could I do
> >> this?
> >>
> >> For example:
> >>
> >> myList = {"abcdefg","hijklmn","prstuv"};
> >>
> >> myList/.{x_String -> StringReplace[x, "a" -> StyleForm["a", FontColor ->
> >> Red]]}
> >>
> >> I was thinking to hodgepodge together statements like this, but it doesn't
> >> work because StringReplace requires objects with head String, and my attempt
> >> has an object with head StyleForm.
> >>
> >> Any advice?
> >>
> >> --
> >> Curt Fischer
> >


  • Prev by Date: RE: Re: Precision of output
  • Next by Date: Re: Extracting Coefficients and Powers
  • Previous by thread: Re: colored alphabet for string output
  • Next by thread: Re: colored alphabet for string output