\usemodule[pre-general]
\setupbodyfont[ams,pos,14.4pt]
\setupcolors [state=start]
\definecolor [NoneColor] [s=.6]
\definecolor [GotoColor] [b=.6] \definecolor[blue] [GotoColor]
\definecolor [ExitColor] [r=.6] \definecolor[red] [ExitColor]
\definecolor [JumpColor] [s=.6]
\definecolor [UserColor] [g=.6] \definecolor[green] [UserColor]
\definecolor [StepColor] [r=.6,g=.6] \definecolor[yellow][StepColor]
\definecolor [PageColor] [s=.80] \definecolor[gray] [PageColor]
\definecolor [TextColor] [s=.90]
\setuppapersize
[S6][S6]
\setuplayout
[width=530pt,
height=400pt,
header=0pt,
footer=0pt,
backspace=15pt,
topspace=15pt,
bottomdistance=15pt,
bottom=10pt,
margin=0pt,
rightedgedistance=15pt,
rightedge=30pt]
\setupinteractionscreen
[option=max]
\setupbackgrounds
[page]
[background=color,
backgroundcolor=PageColor]
\setupbackgrounds
[text][text]
[background=color,
backgroundcolor=TextColor,
backgroundoffset=5pt]
\setupinteraction
[state=start,
menu=on,
color=UserColor,
contrastcolor=NoneColor]
\setupsubpagenumber
[state=start,
way=bytext]
\setupinteractionmenu
[right]
[state=start,
frame=off,
strut=no,
offset=0pt,
inbetween=,
bottomoffset=-5pt,
topoffset=-5pt]
\startinteractionmenu[right]
\setupinteraction[color=GotoColor]
\but [previoussubpage] \Triangle {90}\framedwidth\interactioncolor \\
\vskip10pt
\but [nextsubpage] \Triangle{270}\framedwidth\interactioncolor \\
\vfill
\but [PreviousJump] \Triangle{180}\framedwidth{NoneColor} \\
\vskip-5pt
\but [NextJump] \Triangle {0}\framedwidth{NoneColor} \\
\stopinteractionmenu
\setupinteractionbar
[alternative=f,
width=\textwidth,
height=\bottomheight,
distance=10pt,
color=NoneColor,
contrastcolor=StepColor]
\setupbottomtexts
[\interactionbar]
\def\CloseButton
{\button
[width=\rightedgewidth,height=\bottomheight,offset=overlay,
background=color,backgroundcolor=ExitColor,frame=off]
{}
[CloseDocument]}
\setupbottomtexts
[edge][][\CloseButton]
\definesymbol[1][$\blacktriangleright$]
\definesymbol[2][$\blacktriangledown$]
\definesymbol[3][$\blacktriangleright$]
\definesymbol[4][$\blacktriangledown$]
\setupitemize[each][color=NoneColor]
\defineoverlay [TitleGraphic] [\useMPgraphic{title}]
\defineoverlay [NextPage] [\overlaybutton{nextpage}]
\def\StartTitlePage
{\setupbackgrounds[page][background={color,TitleGraphic,NextPage}]
\setupbackgrounds[text][text][background=]
\setupinteraction[menu=off]
\setupinteractionbar[state=stop]
\startstandardmakeup
\switchtobodyfont[24pt]
\bfd\setupinterlinespace
\setupalign[middle]
\vfil
\let\\=\vfil}
\def\StopTitlePage
{\vfil\vfil\vfil
\stopstandardmakeup
\setupinteraction[menu=on]
\setupinteractionbar[state=start]
\setupbackgrounds[page][background=color]
\setupbackgrounds[text][text][background=color]
\setupsubpagenumber[reset]}
\def\TitlePage#1
{\StartTitlePage#1\StopTitlePage}
\definehead [Topic] [chapter]
\definehead [Nopic] [title]
\definehead [Subject] [section]
\setuphead
[Topic, Nopic]
[after={\blank[3*medium]},
number=no,
style=\tfb,
page=yes,
alternative=middle]
\setuphead
[Subject]
[after=\blank,
number=no,
page=yes,
continue=no,
style=\tfa]
\setuplist
[Topic,Subject]
[alternative=g,
interaction=all,
before=,
after=]
\setuplist
[Topic]
[criterium=all]
\def\Topics#1
{\determinelistcharacteristics[Topic]
\ifnum\utilitylistlength>0
\Nopic[Topics]{#1}
\ifnum\utilitylistlength>12
\startcolumns
\placelist[Topic]
\stopcolumns
\else
\placelist[Topic]
\fi
\fi}
\def\Subjects
{\placelist[Subject]}
\startMPinclusions
def triangle (expr wid, rot, col) =
x1 := x3 := y1 := 0 ; x2 := y3 := wid ; y2 := .5y3 ;
fill (z1--z2--z3--cycle) rotated rot withcolor col ;
currentpicture := currentpicture xysized (wid,wid) ;
enddef ;
\stopMPinclusions
\setupMPvariables
[triangle]
[width=1cm,
rotation=0,
color=black]
\startuniqueMPgraphic{triangle}{width,rotation,color}
triangle(\MPvar{width},\MPvar{rotation},\MPvar{color}) ;
\stopuniqueMPgraphic
\def\Triangle#1#2#3
{\uniqueMPgraphic{triangle}{rotation=#1,width=#2,color=#3}}
\startuseMPgraphic{title}
color c ; path p ;
for i=1 upto 250 :
x0 := uniformdeviate \overlaywidth ;
y0 := uniformdeviate \overlayheight ;
sx := uniformdeviate 20 ;
sy := uniformdeviate 20 ;
cc := round(uniformdeviate 2) ;
if cc=0 : c := \MPcolor{GotoColor} fi ;
if cc=1 : c := \MPcolor{ExitColor} fi ;
if cc=2 : c := \MPcolor{StepColor} fi ;
qq := round(uniformdeviate 1) ;
if qq=0 :
p := unitsquare xscaled sx yscaled sy ;
else :
rr := round(uniformdeviate 3) * 90 ;
x1 := x3 := y1 := 0 ; x2 := y3 := sx; y2 := .5y3 ;
p := (z1--z2--z3--cycle) rotated rr ;
fi ;
fill p shifted z0 withcolor c ;
endfor ;
\stopuseMPgraphic
\doifnotmode{demo}{\endinput}
\starttext
\TitlePage{Title Page\\pre-colorfull}
\Topics{Some Nice Quotes}
\Topic{A Few}
\Subject{Knuth} \input knuth
\Subject{Tufte} \input tufte
\Topic{Some More}
\Subject{Zapf} \input zapf
\Subject{Bryson} \input bryson
\stoptext