From f74202922bab67f1497756b318b926e8dffd99af Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 22 Jan 2025 10:52:47 -0800 Subject: [PATCH] Use #7a7a7a as the grey color in AIShell to meet the contrast requirement --- shell/AIShell.Kernel/Host.cs | 4 ++-- shell/AIShell.Kernel/Shell.cs | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/shell/AIShell.Kernel/Host.cs b/shell/AIShell.Kernel/Host.cs index 7b5a8778..27e94544 100644 --- a/shell/AIShell.Kernel/Host.cs +++ b/shell/AIShell.Kernel/Host.cs @@ -419,7 +419,7 @@ public async Task PromptForSelectionAsync(string title, IEnumerable cho .Title(title) .PageSize(10) .UseConverter(converter) - .MoreChoicesText("[grey](Move up and down to see more choices)[/]") + .MoreChoicesText("[#7a7a7a](Move up and down to see more choices)[/]") .AddChoices(choices); return await selection.ShowAsync(ansiConsole, cancellationToken).ConfigureAwait(false); @@ -468,7 +468,7 @@ public async Task PromptForTextAsync(string prompt, bool optional, IList RequireStdoutOrStderr(operation); IAnsiConsole ansiConsole = _outputRedirected ? _stderrConsole : AnsiConsole.Console; - string promptToUse = optional ? $"[grey][[Optional]][/] {prompt}" : prompt; + string promptToUse = optional ? $"[#7a7a7a][[Optional]][/] {prompt}" : prompt; var textPrompt = new TextPrompt(promptToUse) { AllowEmpty = optional }; if (choices?.Count > 0) diff --git a/shell/AIShell.Kernel/Shell.cs b/shell/AIShell.Kernel/Shell.cs index 83866aed..c353ee4c 100644 --- a/shell/AIShell.Kernel/Shell.cs +++ b/shell/AIShell.Kernel/Shell.cs @@ -132,8 +132,10 @@ internal void ShowBanner() { string banner = _wrapper?.Banner is null ? "AI Shell" : _wrapper.Banner; string version = _wrapper?.Version is null ? _version : _wrapper.Version; + + // The color '#7a7a7a' is most close to 'grey' but with high enough contrast to pass the contrast checker. Host.MarkupLine($"[bold]{banner.EscapeMarkup()}[/]") - .MarkupLine($"[grey]{version.EscapeMarkup()}[/]") + .MarkupLine($"[#7a7a7a]{version.EscapeMarkup()}[/]") .WriteLine(); } @@ -286,7 +288,7 @@ private void LoadAvailableAgents() chosenAgent ??= _agents.Count is 1 ? _agents[0] : Host.PromptForSelectionAsync( - title: "Welcome to AI Shell! We’re excited to have you explore our [bold]Public Preview[/]. Documentation is available at [link=https://aka.ms/AIShell-Docs]aka.ms/AIShell-Docs[/], and we’d love to hear your thoughts - share your feedback with us at [link=https://aka.ms/AIShell-Feedback]aka.ms/AIShell-Feedback[/].\n\n[orange1]Please select an AI [Blue]agent[/] to use[/]:\n[grey](You can switch to another agent later by typing [Blue]@[/])[/]", + title: "Welcome to AI Shell! We’re excited to have you explore our [bold]Public Preview[/]. Documentation is available at [link=https://aka.ms/AIShell-Docs]aka.ms/AIShell-Docs[/], and we’d love to hear your thoughts - share your feedback with us at [link=https://aka.ms/AIShell-Feedback]aka.ms/AIShell-Feedback[/].\n\n[orange1]Please select an AI [Blue]agent[/] to use[/]:\n[#7a7a7a](You can switch to another agent later by typing [Blue]@[/])[/]", choices: _agents, converter: static a => a.Impl.Name) .GetAwaiter().GetResult();