lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tweak grobs with callback output?


From: Trevor Bača
Subject: Re: Tweak grobs with callback output?
Date: Wed, 19 Jul 2023 15:54:41 -0400



On Wed, Jul 19, 2023 at 3:41 PM Jean Abou Samra <jean@abou-samra.fr> wrote:

    \tweak color #(if (equal? DOWN (ly:grob-property grob 'direction)) red blue)

You just forgot to wrap the _expression_ in (lambda (grob) ...) .


Yes, that's it:

%%% BEGIN %%%

\version "2.25.3"
\markup "Conditionally colors both tuplet brackets:" \markup \vspace #1

{
  \once \override TupletBracket.color = #(lambda (grob)
    (if (equal? DOWN (ly:grob-property grob 'direction)) red blue)
  )
  \times 2/3 {
    \times 2/3 { c'4 c' c' }
    c'2
    c'2
  }
}

\markup "Conditionally colors only the inner tuplet bracket:" \markup \vspace #1

{
  \times 2/3 {
    \tweak color #(lambda (grob)
        (if (equal? DOWN (ly:grob-property grob 'direction)) red blue))
    \times 2/3 { c'4 c' c' }
    c'2
    c'2
  }
}

%%% END %%%

Thanks very much again, Jean.

Trevor.

--

Attachment: conditional-tweaks.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]