The LilyPond Snippet Repository ♪♫

What's this? Searching the LSR Browse Contributing Snippet database

Results 1−10 of 44 for color

Setting a color for all staff objects automatically [obsolete in 2.25] [0.39286]

Setting a color for all staff objects automatically [obsolete in 2.…

To color all objects on a staff is a laborious … …context can then be colored by setting their color property. This snippet is obsolete in LilyPond 2.… …which introduces a much simpler method: \layout { property-defaults.color = "blue" }

…it/LSR/Item?id=443 #(define (override-color-for-all-grobs color) (lambda (context) (let loop ((x all-grob-descriptions)) (if (not (… …x)) (let ((grob-name (caar x))) (ly:context-pushpop-property context grob-name 'color color) (loop (cdr x))))))) \relative c' { \applyContext #(override-color-for-all-grobs (…

Setting a color for all staff objects automatically [obsolete in 2.25]

Background color [0.28571]

Background color

…LilyPond does not allow to specify a background color, it is possible to give the illusion of …

…with-dimensions #'(0 . 0) #'(0 . 0) % specify color \with-color #(rgb-color 1 0.5 0.5) % …

Background color

Coloring successive intervals [0.28348]

…can be added to every Voice context. Usage: \color_interval_engraver #intervaldefs #debug? #intervals-given intervaldefs: alist containing … …argument: 2, needs to be a direction. Warning: Color_interval_engraver: Recoloring note head in Voice N/… …1.0 0.0 0.0)) Warning: Adding color_interval_engraver to a Staff context may lead …

…4 steps %% %% The engraver consists of two parts: %% %% color_interval_engraver: checks, whether the given parameters are … …fis eis fis r } >> \layout { \context { \Voice \consists \color_interval_engraver #intervaldefs ##t #`(("2-" ,DOWN #f ,… …fis eis fis r } >> \layout { \context { \Staff \consists \color_interval_engraver #intervaldefs #`(("4" ,UP #f ,red) ("…

Coloring successive intervals

Coloring objects [0.26786]

…and so on, by simply overriding the #'color property and choosing your color (as explained in the Notation Reference, it is possible to obtain about any color).

…LSR/Item?id=242 \relative c' { \override Accidental.color = #darkgreen \override Beam.color = #cyan \override NoteHead.color = … …g \override NoteHead.color = #darkblue b \override NoteHead.color = #green \override Stem.color = #blue e8 es d dis e4 r }

Coloring objects

Coloring grobs and notational elements using a sophisticated music function [0.26339]

Some scholarly or ‘urtext’ editions use grey color to indicate editorial additions. I find this very … …at the least since 2.19.8. The color may be optionally specified to use another than the default color (defined as editorsColor). In order to conveniently address …

…#grey ed = #(define-music-function (grob col mus) (symbol-list-or-symbol? (color? editorsColor) ly:music?) ;; for abbreviations, we need a symbol … …mus #}) ;; ‘normal’ case (else #{ \override $grob . color = #col $mus \revert $grob . color #})))) %%%%%%%%%%%%%%%%%%%%%%%%%% EXAMPLE %%%%%%%%%%%%%%%%%%%%%%%%%% \relative { \ed Note { c'8 d16. …

Coloring grobs and notational elements using a sophisticated music function

Affecting items only on the left or right of a line break (BarLines, KeySignatures, Clefs, etc.) [0.21429]

If you want to affect the behaviour (color, rotation, translate, etc.) of an item at a …

…ly:item? g) (equal? (ly:item-break-dir g) RIGHT)) (ly:grob-set-property! g 'color red))) #(define (rotate-at-line-begin g) (if (and (ly:item? … …ly:item? g) (equal? (ly:item-break-dir g) LEFT)) (ly:grob-set-property! g 'color color))) #{ \once\override Staff.BarLine.after-line-breaking = #color-at-line-end #}) %…

Affecting items only on the left or right of a line break (BarLines, KeySignatures, Clefs, etc.)

Outliner [0.21429]

Outliner helps outlining markups with a defined color.

…get-caddr-if-condition (lambda (e) (if (and (list? e) (member 'color e)) ;; the stencil-expr of a colored stencil is … …define-markup-command (outliner layout props thickness color arg) (number? color? markup?) #:category other #:properties ((angle-increments 16) (radial-increments 1)) (… …interpret-markup layout props arg) (* thickness (ly:output-def-lookup layout 'line-thickness)) color angle-increments radial-increments)) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% A new G clef defs: clef-henle = …

Outliner

Color Gradient using Postscript [0.21429]

Color Gradient using Postscript

Lilypond has no way of creating color gradients. This markup function duplicates the path markup, …

Color Gradient using Postscript

Dark Mode Sheet Music [0.21429]

…background of the page, respectively. Any objects whose color has been manually specified won’t have print-color … …requires explicit overriding of whiteout-color (or the optional color argument to the \whiteout markup command) in recent …

…grayNN" equivalents) #(define-markup-command (color-sample layout props clr) (color?) (let ((name (if (string? clr) (string-append "\"" clr "\"") (string-append "… …color-sample "navajowhite" } \vspace #.3 \line { The background color may also be adjusted through the paper variable \…

Dark Mode Sheet Music

Coloring notes depending on their pitch [0.20536]

It is possible to color note heads depending on their pitch and/or …

…p1) (ly:pitch-notename p2)))) #(define (pitch-to-color pitch) (let ((color (assoc pitch color-mapping pitch-equals?))) (if color (cdr color)))) #(define (color-notehead grob) (pitch-to-color (ly:event-property (event-cause grob) 'pitch))) \score { \new Staff \relative c' { \override NoteHead.color = #color-notehead c8 b d dis ees f g …

Coloring notes depending on their pitch

1 2 3 4 5 Next ⇨