Hello Stu
> In lilypond-user Digest, Vol 285, Issue 7, Yoshiaki Onishi posted a
> solution to color various barlines.
> I'm attempting to take this further by coloring the 'section' and 'fine'
> bar lines in red too.
> What is the syntax to convert only 'section' barlines to red and 'fine'
> barlines to red and leave other barlines in black?
> Here's a MWE using the '\once' for each:
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \version "2.26.0"
> musicOne = {
> R1
> R1
> % \section barline in red
> \once \override Staff.BarLine.color = #red \section
> R1
> R1
> % fine barline in red
> \once \override Staff.BarLine.color = #red \fine
> }
> \score {
> \musicOne
> }
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if you really want to only affect \section barlines you could override the
section command. But if you generally want to target all double barlines, all
stop barlines etc. it is easy to have color depend on the glyph:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\version "2.26.0"
musicOne = {
\override Staff.BarLine.color =
#(lambda (grob)
(let ((glyph (ly:grob-property grob 'glyph)))
(cond ((member glyph '("||" "|.")) red)
(else #f))))
R1
R1
% \section barline in red
\section
R1
R1
% fine barline in red
\fine
}
\score {
\musicOne
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Cheers,
Tina
signature.asc
Description: This is a digitally signed message part.
