Colorful CD Inlay

From Wiki
Jump to navigation Jump to search

Another sample from Hans. Download the pdf or the tex file. This is what the result looks like:

Fiona.png

\starttext

\usetypescriptfile[type-ghz]
\definetypeface[mainface][ss][sans][optima-nova][default][encoding=texnansi]
\setupbodyfont[mainface]

\setupcolors[state=start]

\startuseMPgraphic{whatever}
    for i = .3 step .1 until .9 :
        fill fullsquare
            scaled 5cm
            shifted (i*10*5cm,0)
            withcolor transparent(1,.5,(i*red)) ;
        fill fullsquare
            scaled 5cm
            shifted (i*10*5cm,4cm)
            withcolor transparent(1,.5,(white-(i*red))) ;
    endfor ;
    addbackground withcolor .75white ;
    currentpicture := currentpicture xysized(OverlayWidth+.5pt,OverlayHeight+.5pt) ;
\stopuseMPgraphic

\startTEXpage

\defineoverlay[whatever][\useMPgraphic{whatever}]
\defineoverlay[origin]  [\setups{origin}]

\startsetups origin
    \vbox to \overlayheight {
        \vfill\tfxx\setstrut
        \hsize\overlaywidth
        \hfill Fiona Apple\enspace EM\enspace2005\quad\strut\endgraf
        \kern1ex
    }
\stopsetups

\framed
  [background={whatever,origin},height=8cm,frame=off]
  {\quad
   I don't understand about complementary colors\quad
   And what they say\quad
   Side by side they both get bright\quad
   Together they both get gray\quad}
\stopTEXpage

\stoptext