AnsiConsole.MarkupLine("[yellow]Hello[/] [red]World[/]");
2.背景色 前端色 on 背景色 ,默认色用 default on 背景色
AnsiConsole.MarkupLine("[yellow on blue]Hello[/] [red]World[/]");

备注:颜色配置:https://spectreconsole.net/appendix/colors
按指定文本格式输出 - StylesAnsiConsole.MarkupLine("[underline]Hello[/] [red]World[/]");
备注:格式配置:https://spectreconsole.net/appendix/styles
按表格输出 - TableTable table = new Table();table.AddColumn(new TableColumn("姓名"));table.AddColumn(new TableColumn("性别"));table.AddRow("张三", "男").AddEmptyRow();table.AddRow("[red]李四[/]", "女").AddEmptyRow();table.AddRow("[yellow]王五[/]", "男");AnsiConsole.Write(table);
Tree tree = new Tree("文件").Style("red");tree.AddNode("[blue]新建[/]");tree.AddNode("[yellow]编辑[/]");tree.AddNode("保存");tree.AddNode(new Table().AddColumn("姓名") .AddColumn("性别") .AddColumn("年事") .AddRow("张三", "男", "30") .AddRow("李四", "女", "20"));AnsiConsole.Write(tree);
更多其它的配置和输出格式,请访问官网:https://spectreconsole.net/