mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-15 00:12:50 +08:00
30 lines
818 B
C#
30 lines
818 B
C#
using Spectre.Console;
|
|
|
|
namespace Colors;
|
|
|
|
public static class Program
|
|
{
|
|
public static void Main()
|
|
{
|
|
AnsiConsole.ResetDecoration();
|
|
AnsiConsole.WriteLine();
|
|
|
|
if (AnsiConsole.Profile.Capabilities.Ansi)
|
|
{
|
|
AnsiConsole.Write(new Rule("[bold green]ANSI Decorations[/]"));
|
|
}
|
|
else
|
|
{
|
|
AnsiConsole.Write(new Rule("[bold red]Legacy Decorations (unsupported)[/]"));
|
|
}
|
|
|
|
var decorations = System.Enum.GetValues(typeof(Decoration));
|
|
foreach (var decoration in decorations)
|
|
{
|
|
var name = System.Enum.GetName(typeof(Decoration),decoration);
|
|
AnsiConsole.Write(name + ": ");
|
|
AnsiConsole.Write(new Markup(name+"\n", new Style(decoration: (Decoration)decoration)));
|
|
}
|
|
}
|
|
}
|