Hi,

Two examples appear below.

The first works; it uses \override with a callback.

The second doesn't work; it attempts to use \tweak with a callback:

%%% 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 "How to conditionally color only the inner tuplet bracket?" \markup
\vspace #1

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

%%% END %%%

Is there a way to tweak grobs with callback output?

Trevor.

-- 
Trevor Bača
www.trevorbaca.com
soundcloud.com/trevorbaca

Reply via email to