copyStyle function
Copies base (or a fresh Style) and sets Style.hasDarkBackground
to the current terminal background state.
Implementation
Style copyStyle(Style? base) {
final style = (base ?? Style()).copy();
style.hasDarkBackground = hasDarkBackground;
return style;
}