Problem
The \setupbackgrounds
macro has the ability to change the background colour of the margins, from the top of the page to the bottom:
\setupbackgrounds[footer,header,text][rightmargin][
background=color,
backgroundcolor=blue,
]
However, once set, there does not seem to be a way to stop the backgrounds. This is preventing me from setting the background colour for only the chapter pages.
I'm fairly certain I could use a layer for this, but since \setupbackgrounds
already has context for the right margin's header, footer, and text areas, I thought it would be easiest to commandeer this macro:
\setuphead[chapter][
header=empty,
footer=empty,
before={%
\setupbackgrounds[footer,header,text][rightmargin][
background=color,
backgroundcolor=blue,
state=repeat,
]
},
after={%
\setupbackgrounds[footer,header,text][rightmargin][
background=color,
backgroundcolor=blue,
state=stop,
]
}
]
The state=stop
doesn't stop the margin from being blue after the chapter page. Rather, the blue continues in the margin for the remainder of the document. I tried to stop the blue within the section:
\setuphead[section][
before={%
\setupbackgrounds[][][state=stop]
}
]
Question
Is it possible to use a \setupbackground
in this way (if so, how)?
If not, how would you use a layer to fill in the right-hand margin from the top of the page to the bottom?