Hi Harm,

On 01.01.25 14:00, Thomas Morley wrote:
This should always give a black background, all other objects should
be colored with `page-color`, apart from objects which already have a
color.

this is great! How about the attached file for an LSR snippet? Do you want to upload it yourself?

Best, Simon
\version "2.24.0"

\paper {
  page-color = #white

  #(define (page-post-process layout pages)
     (let ((color (ly:output-def-lookup $defaultpaper 'page-color #f)))
       (when (color? color)
         (for-each
          (lambda (page)
            (let ((page-stencil (ly:prob-property page 'stencil)))
              (set! (ly:prob-property page 'stencil)
                    (ly:stencil-add
                     (make-filled-box-stencil
                      (ly:stencil-extent page-stencil X)
                      (ly:stencil-extent page-stencil Y))
                     (stencil-with-color page-stencil color)))))
          pages))))
}

\header {
  title = \markup { Rendering LilyPond files white on black }
  subtitle = \markup { for screen and projector use }
}
\markup { Any objects with unspecified colour are printed according to \typewriter page-color. }
\markup \left-column {
  \line { Here are samples of pure white along with other colours that may be easier on the eye: }
  \typewriter {
    \line \general-align #Y #-1 { \beam #5 #0 #2 "\"white\"" }
    \line \general-align #Y #-1 \with-color #"ivory" { \beam #5 #0 #2 "\"ivory\"" }
    \line \general-align #Y #-1 \with-color "antiquewhite" { \beam #5 #0 #2 "\"antiquewhite\"" }
    \line \general-align #Y #-1 \with-color "navajowhite" { \beam #5 #0 #2 "\"navajowhite\"" }
  }
}

{ 1 }

Attachment: test-whiteonblack-harm-2025-for-lsr.pdf
Description: Adobe PDF document

Reply via email to