I believe this may be a case where you need to use \applyOutput, as documented here: https://extending-lilypond.readthedocs.io/en/latest/extending/translation.html#tweaking-grobs-during-translation .
On Tue, Jan 31, 2023 at 5:57 PM Ahanu Banerjee <athecell...@gmail.com> wrote: > I am trying to modify the color of the ledger lines for a single note. My > understanding is that I need to use \stopStaff and \startStaff for this. > However, doing so causes the staff lines to be discontinuous. This rounds > the ends of the staff lines surrounding the point at which the staff is > stopped and causes adjacent notes to have increased horizontal spacing. How > can this be avoided? > > See code below. > > \version "2.24.0" > \language "english" > { g8 \stopStaff \startStaff > \once \override Staff.LedgerLineSpanner.color = green > g \stopStaff \startStaff g g } > > Thanks, > -Ahanu >