lilypond-user
[Top][All Lists]
Advanced

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

Re: background colour


From: Klaus Blum
Subject: Re: background colour
Date: Sun, 12 Jun 2016 10:01:57 -0700 (MST)

Hi Christian, 


Christian-186 wrote
> Does anybody know how to make the background black?

http://lsr.di.unimi.it/LSR/Item?id=969
<http://lsr.di.unimi.it/LSR/Item?id=969>   offers a colored background for
markups. 
You could modify it to produce a background in fixed dimensions:
%
---------------------------------------------------------------------------------
\version "2.19.25"

#(define-markup-command (on-color layout props color arg) (color? markup?)
   (let* ((stencil (interpret-markup layout props arg))
          (X-ext (cons -200 200))
          (Y-ext (cons -200 200)))
     (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)))

\header {
  title = \markup \on-color #green "This is the title"
}

\score { \repeat unfold 20 { c' d' e' f'} }
%
---------------------------------------------------------------------------------

If your score contains more than one page, one could apply similar things to
e.g. the page numbers. 
Unlike  http://lsr.di.unimi.it/LSR/Item?id=699
<http://lsr.di.unimi.it/LSR/Item?id=699>  , the background rectangle would
not cover the header area. 

Cheers, 
Klaus



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/background-colour-tp191554p191568.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

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