Jump to content

RGB colors

From LilyPond wiki
(Redirected from LSR 420)

In addition to the built-in x11-color system, it is possible to get exact RGB colors by specifying the amounts of red, green and blue.

\version "2.24.0"

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

\relative c''{
  \override Staff.StaffSymbol.color = #(x11-color 'SlateBlue2)
  \set Staff.instrumentName = \markup {
    \with-color #(x11-color 'navy) Clarinet
  }

  %black
  \override Stem.color = #(rgb-color 0 0 0)
  gis8 a
  % white
  \override Stem.color = #(rgb-color 1 1 1)
  gis8 a
  % dark blue
  \override Stem.color = #(rgb-color 0 0 0.5)
  gis4 a
}