Jump to content

Coloring elements of notation: Difference between revisions

From LilyPond wiki
Import snippet from LSR
 
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series
Line 1: Line 1:
Individual objects may be assigned colors. Several pre-defined colors are available; they are exhaustively listed in the Notation Reference.
Individual objects may be assigned colors. Several pre-defined colors are available; they are exhaustively listed in the Notation Reference.


<lilypond version="2.24.0">
<lilypond version="2.24">
%% http://lsr.di.unimi.it/LSR/Item?id=419
%% http://lsr.di.unimi.it/LSR/Item?id=419



Revision as of 18:45, 16 November 2025

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

\version "2.24"

%% http://lsr.di.unimi.it/LSR/Item?id=419

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