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