Lesson 3 colors and styles
This commit is contained in:
@ -1,11 +1,25 @@
|
|||||||
using Spectre.Console;
|
using Spectre.Console;
|
||||||
|
|
||||||
|
#region "Previous Lessons"
|
||||||
//Lesson 2 - Initial Setup
|
//Lesson 2 - Initial Setup
|
||||||
AnsiConsole.MarkupLine("[bold red]Hello, World![/]");
|
//AnsiConsole.MarkupLine("[bold red]Hello, World![/]");
|
||||||
AnsiConsole.MarkupLine("Hello, World!");
|
//AnsiConsole.MarkupLine("Hello, World!");
|
||||||
AnsiConsole.MarkupLine("[slowblink]Hello, World![/]");
|
//AnsiConsole.MarkupLine("[slowblink]Hello, World![/]");
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
// Lesson 3 - Colors and styles
|
||||||
|
|
||||||
|
AnsiConsole.MarkupLine("[red]This is the inline markup[/]");
|
||||||
|
AnsiConsole.MarkupLine("[red on white]This is the inline markup[/]");
|
||||||
|
AnsiConsole.MarkupLine("[red on white bold]This is the inline markup[/]");
|
||||||
|
Style danger = new Style(
|
||||||
|
foreground: Color.Red,
|
||||||
|
background: Color.White,
|
||||||
|
decoration: Decoration.Bold | Decoration.Italic
|
||||||
|
);
|
||||||
|
|
||||||
|
AnsiConsole.Write(new Markup("Danger Text from Style\n", danger));
|
||||||
|
AnsiConsole.WriteLine(" and more...");
|
||||||
|
|
||||||
Console.ReadLine();
|
Console.ReadLine();
|
||||||
AnsiConsole.Clear();
|
AnsiConsole.Clear();
|
||||||
Reference in New Issue
Block a user