Thank you very muchCarl. It works perfectly with text. Not for the back of the cell. That's already good. Thank you again. Have a nice day. JP Envoyé de mon iPad
> Le 9 janv. 2026 à 13:35, Carl Sorensen <[email protected]> a écrit : > > On Fri, Jan 9, 2026 at 4:46 AM achard <[email protected]> wrote: >> >> >> Hello >> Thanks for the reply. I'll try it.. >> JPierre >> >> Here's an example: I'd like to color, for example, the background of squares >> 1 and 2 blue, the background of squares 3 and 4 red, etc. >> At worst, color the text.. > > Thanks for the code -- it let me try it. > > I found that my previous reply actually didn't work. Although the > ChordSquare does accept the whiteout property, it actually doesn't > draw the whiteout box correctly. I believe this is a bug in the > ChordSquare code. > > But you can change the color of the chord names and the repeats: > > %%%% Code begins > \version "2.24" > \score { > \new ChordGrid \chordmode > { > \override GridChordName.Parentheses.font-size = #2 > %\set chordRootNamer = #chordNamer % substitution du nomage > des accords > % \set chordNameExceptions = #chJazz % substitution de > l'affichage des extensions > \override GridChordName.font-size = #3 > \override GridChordName.font-name = #'"lilyjazzchord" > \set chordChanges = ##t > \set noChordSymbol = "—" > { > %\override ChordGrid.ChordSquare.whiteout = ##t > % \override ChordGrid.ChordSquare.whiteout-color = #(rgb-color 1 0 0) > \override GridChordName.color = #(rgb-color 1 0 0) > \override PercentRepeat.color = #(rgb-color 1 0 0) > \repeat percent 2 {d1:6.9} > \override GridChordName.color = #(rgb-color 0 1 0) > \override PercentRepeat.color = #(rgb-color 0 1 0) > \repeat percent 2 {e:9} > \override GridChordName.color = #(rgb-color 0 0 1) > e:m9 > \override GridChordName.color = #(rgb-color 0.5 .5 0) > a:7.13 > \override GridChordName.color = #(rgb-color 0 0.5 0.5) > \override PercentRepeat.color = #(rgb-color 0 0.5 0.5) > \repeat percent 2 {d1:6.9} > \break > } > } > \layout > { > \context > { > \ChordGrid > slashChordSeparator = % is only a dividing line; > #(make-with-dimensions-markup (cons 0 0) (cons 0 0) ;; displaces nothing > (make-translate-markup (cons -1 > -1.5) ;; just clear of root-stuff base > > (make-rotate-markup -45 "/"))) % roughly perp to bass/root axis > chordNoteNamer = #(lambda (p l?) > (make-lower-markup 2.0 ;; not too cramped > but still belonging graphically > (make-small-markup ;; as > qualifier is subordinate to root name > > (note-name->markup p l?)))) > } > } > } > > HTH, > > Carl > > P.S. The code you sent was missing the definitions of chordNamer and > chJazz, so I had to comment out those lines. >
