Jump to content

Coloring elements of notation: Difference between revisions

From LilyPond wiki
No edit summary
Tags: Reverted Visual edit
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
Individual objects may be assigned colors. Several pre-defined colors are available; they are [https://lilypond.org/doc/v2.25/Documentation/notation/list-of-colors.html exhaustively listed] in the Notation Reference.
Individual objects may be assigned colors. Several pre-defined colors are available; they are [https://lilypond.org/doc/v2.25/Documentation/notation/list-of-colors.html exhaustively listed] in the Notation Reference.


<span></span>
<lilypond version="2.24">
\version "2.24"
\relative c'' {
  \override NoteHead.color = #red
%% <nowiki>http://lsr.di.unimi.it/LSR/Item?id=419</nowiki>
  c4 c
  \override NoteHead.color = #(x11-color 'LimeGreen)
\relative c<nowiki>''</nowiki> {
  d
<nowiki> </nowiki> \override NoteHead.color = #red
  \override Stem.color = #blue
<nowiki> </nowiki> c4 c
  e
<nowiki> </nowiki> \override NoteHead.color = #(x11-color 'LimeGreen)
}
<nowiki> </nowiki> d
</lilypond>
<nowiki> </nowiki> \override Stem.color = #blue
<nowiki> </nowiki> e
}
<span></span>


[[Category:Editorial annotations]]
[[Category:Editorial annotations]]
[[Category:Really simple]]
[[Category:Really simple]]
[[Category:Snippet]]
[[Category:Snippet]]

Latest revision as of 11:37, 7 April 2026

Individual objects may be assigned colors. Several pre-defined colors are available; they are exhaustively listed in the Notation Reference.

\version "2.24"

\relative c'' {
  \override NoteHead.color = #red
  c4 c
  \override NoteHead.color = #(x11-color 'LimeGreen)
  d
  \override Stem.color = #blue
  e
}