David Kastrup <[email protected]> writes:

> Thomas Morley <[email protected]> writes:
>
>>>>>You can write:
>>>>>colorizeDir =
>>>>>#(define-music-function (parser location item)
>>>>>   (symbol-list-or-music?)
>>>>>   (define (grob-colorize-dir grob)
>>>>>     (let ((ev (event-cause grob)))
>>>>>       (case (ly:event-property ev 'direction)
>>>>>             ((1) red)
>>>>>             ((-1) blue)
>>>>>             (else '()))))
>>>>>   #{ \tweak color #grob-colorize-dir #item #})
>>>>
>>>> Thanks, this works perfectly.

Actually, it's oversimplified.  It has to have

(case (and ev (ly:event-property ev 'direction))

or it will bomb out in the cases of coloring grobs not traceable to a
music event.

-- 
David Kastrup


_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to