2016-09-20 23:30 GMT+02:00 Malte Meyn <lilyp...@maltemeyn.de>:
>
>
> Am 20.09.2016 um 19:12 schrieb PMA:
>>
>> (define (colorNote n)
>>   (cond ((eq? (- n) 1) 'red )
>>         ((eq? (- n) 2) 'blue)))
>
>
> This returns the symbol 'red or the symbol 'blue, not the constant named red
> (value (1.0 0.0 0.0)) or the constant named blue.

For the record, with x11-color you can use symbols.

#(define (colorNote n)
  (case n
    ((-1) 'red)
    ((-2) 'blue)
    (else '())))

FS =
#(define-music-function (parser location offset) (number?)
  #{
    \override NoteHead.font-size = #offset
    \override NoteHead.color = #(x11-color (colorNote offset))
  #})

{ \FS -1 c'1 }

Cheers,
  Harm

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to