lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Global Color Changes


From: Klaus Blum
Subject: Re: Global Color Changes
Date: Sun, 10 May 2015 02:42:30 -0700 (MST)

One last idea: 

If you don't want to change the settings for the entire page, you could also
try like this:

%
----------------------------------------------------------------------------
\version "2.18.2"

% Taken from:
% http://lsr.di.unimi.it/LSR/Item?id=969

#(define-markup-command (on-color layout props color arg) (color? markup?)
   (let* ((stencil (interpret-markup layout props arg))
          (X-ext (ly:stencil-extent stencil X))
          (Y-ext (ly:stencil-extent stencil Y)))
     (ly:stencil-add (ly:make-stencil
                      (list 'color color
                        (ly:stencil-expr (ly:round-filled-box X-ext Y-ext
0))
                        X-ext Y-ext)) stencil)))

\markup "First example:"

\markup {
  \on-color #blue
  \pad-markup #2
  \with-color #yellow
  \score{
    \layout {indent = 0}
    \relative c' {
      c4 d c2
    }
  }
}

\markup "Second example:"

\markup {
  \rotate #10  %  :-)
  \on-color #red
  \pad-markup #2
  \with-color #green
  \score{
    \layout {indent = 0}
    \relative c' {
      c4 d c2
    }
  }
}
%
----------------------------------------------------------------------------

Cheers, 
Klaus



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Global-Color-Changes-tp176355p176385.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]