From de4cc87ee2fcf85a90b291f0030a4c2b88c82017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommy=20=C3=96man?= Date: Thu, 7 Aug 2025 20:43:03 +0200 Subject: [PATCH] Lesson 3 colors and styles --- SpectreDemos/Program.cs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/SpectreDemos/Program.cs b/SpectreDemos/Program.cs index a4c47f0..a06becd 100644 --- a/SpectreDemos/Program.cs +++ b/SpectreDemos/Program.cs @@ -1,11 +1,25 @@ using Spectre.Console; + +#region "Previous Lessons" //Lesson 2 - Initial Setup -AnsiConsole.MarkupLine("[bold red]Hello, World![/]"); -AnsiConsole.MarkupLine("Hello, World!"); -AnsiConsole.MarkupLine("[slowblink]Hello, World![/]"); +//AnsiConsole.MarkupLine("[bold red]Hello, World![/]"); +//AnsiConsole.MarkupLine("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(); AnsiConsole.Clear(); \ No newline at end of file