iox/Powerline.cs
/// <summary>
/// Add a segment to the powerline.
/// </summary>
/// <returns>The segment.</returns>
/// <param name="text">Text.</param>
/// <param name="fg">Foreground color.</param>
/// <param name="bg">Background color.</param>
Add a segment to the powerline.
Add a segment to the powerline .
public PowerlineBuilder Segment (string text, ANSIColor fg = null, ANSIColor bg = null) {
			fg = fg ?? lastfg;
			bg = bg ?? lastbg;
			if (first) {
				lastfg = fg ?? lastfg;
				lastbg = bg ?? lastbg;
			}
			if (!first) Builder.Append ($"{bg.bg}{lastbg.fg}{PLColor}");
			Builder.Append ($"{bg.bg}{fg.fg} {text}");
			lastfg = fg;
			lastbg = bg;
			if (first) first = false;
			return this;
		}
public PowerlineBuilder Segment ( string text , ANSIColor fg = null , ANSIColor bg = null ) { fg = fg ?? lastfg ; bg = bg ?? lastbg ; if ( first ) { lastfg = fg ?? lastfg ; lastbg = bg ?? lastbg ; } if ( ! first ) Builder . Append ( $" { bg . bg } { lastbg . fg } { PLColor } " ) ; Builder . Append ( $" { bg . bg } { fg . fg } { text } " ) ; lastfg = fg ; lastbg = bg ; if ( first ) first = false ; return this ; }
Add a segment to the powerline.
Add a segment to the powerline .
// $"\x1b[39m\x1b[46m iox \x1b[43m\x1b[36m{PLColor}\x1b[30m test.id \x1b[40m\x1b[33m{PLColor}\x1b[0m"
None
text
string
None
fg
ANSIColor
None
bg
ANSIColor
None