Next: Parentheses, Previous: Hidden notes, Up: Inside the staff
Individual objects may be assigned colors. Valid color names are listed in the List of colors.
\override NoteHead #'color = #red c4 c \override NoteHead #'color = #(x11-color 'LimeGreen) d \override Stem #'color = #blue e
The full range of colors defined for X11 can be accessed by using
the Scheme function x11-color
. The function takes one
argument; this can be a symbol in the form 'FooBar or a
string in the form "FooBar". The first form is quicker to
write and is more efficient. However, using the second form it is
possible to access X11 colors by the multi-word form of its name.
If x11-color
cannot make sense of the parameter then the
color returned defaults to black.
\override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2) \set Staff.instrumentName = \markup { \with-color #(x11-color 'navy) "Clarinet" } gis8 a \override Beam #'color = #(x11-color "medium turquoise") gis a \override Accidental #'color = #(x11-color 'DarkRed) gis a \override NoteHead #'color = #(x11-color "LimeGreen") gis a % this is deliberate nonsense; note that the stems remain black \override Stem #'color = #(x11-color 'Boggle) b2 cis
Exact RGB colors can be specified using the Scheme function
rgb-color
.
\override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2) \set Staff.instrumentName = \markup { \with-color #(x11-color 'navy) "Clarinet" } \override Stem #'color = #(rgb-color 0 0 0) gis8 a \override Stem #'color = #(rgb-color 1 1 1) gis8 a \override Stem #'color = #(rgb-color 0 0 0.5) gis4 a
Notation Reference: List of colors, The tweak command.
Snippets: Editorial annotations.
An X11 color is not necessarily exactly the same shade as a similarly named normal color.
Not all X11 colors are distinguishable in a web browser, i.e.,
a web browser might not display a difference between 'LimeGreen
and 'ForestGreen
. For web use normal colors are recommended
(i.e., #blue
, #green
, #red
).
Notes in a chord cannot be colored with \override
; use
\tweak
instead, see The tweak command.
Diese Seite ist für LilyPond-2.11.58 (Entwicklungszweig).
Fehler bitte an http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs melden.
Ihre Vorschläge für die Dokumentation sind willkommen.