Skip to content

v6: introduce AnsiToken/Color styling model and align styled APIs#18

Merged
dusrdev merged 16 commits intostablefrom
feat-listprogress
Mar 27, 2026
Merged

v6: introduce AnsiToken/Color styling model and align styled APIs#18
dusrdev merged 16 commits intostablefrom
feat-listprogress

Conversation

@dusrdev
Copy link
Copy Markdown
Owner

@dusrdev dusrdev commented Mar 27, 2026

This PR introduces the new token-based styling model for PrettyConsole and promotes Color / Markup / AnsiToken as the preferred public surface for styled output.

Added

  • Added AnsiToken as the styled ANSI abstraction for interpolated output.
  • Added Color as the preferred color surface with tokens like Color.Green, Color.DefaultForeground, Color.DefaultBackground, and Color.Default.
  • Added Windows ANSI capability detection through ConsoleContext.IsAnsiSupported.
  • Added token-based color support to ProgressBar, Spinner, TypeWrite, and LiveConsoleRegion.RenderProgress.
  • Added an implicit conversion from ConsoleColor to foreground AnsiToken for compatibility.

Breaking

  • Markup now exposes AnsiToken values instead of raw string escape sequences.
  • AnsiColors.Foreground(ConsoleColor) and AnsiColors.Background(ConsoleColor) now return AnsiToken instead of raw ANSI strings.

Notes

  • ConsoleColor interpolation still works for compatibility.
  • Low-level Write / WriteLine span APIs and Console.SetColors still use explicit ConsoleColor.
  • 6.0.0 follows released 5.4.2 directly and folds in the unreleased branch work, including LiveConsoleRegion.

@dusrdev dusrdev merged commit e9b2e30 into stable Mar 27, 2026
3 checks passed
@dusrdev dusrdev deleted the feat-listprogress branch March 27, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant