diff --git a/src/Spectre.Console/Prompts/TextPrompt.cs b/src/Spectre.Console/Prompts/TextPrompt.cs index e48ed60..9574df1 100644 --- a/src/Spectre.Console/Prompts/TextPrompt.cs +++ b/src/Spectre.Console/Prompts/TextPrompt.cs @@ -75,12 +75,12 @@ public sealed class TextPrompt : IPrompt, IHasCulture public Func? Validator { get; set; } /// - /// Gets or sets the style in which the default value is displayed. + /// Gets or sets the style in which the default value is displayed. Defaults to green when . /// public Style? DefaultValueStyle { get; set; } /// - /// Gets or sets the style in which the list of choices is displayed. + /// Gets or sets the style in which the list of choices is displayed. Defaults to blue when . /// public Style? ChoicesStyle { get; set; } diff --git a/src/Spectre.Console/Prompts/TextPromptExtensions.cs b/src/Spectre.Console/Prompts/TextPromptExtensions.cs index ea023dd..4fad784 100644 --- a/src/Spectre.Console/Prompts/TextPromptExtensions.cs +++ b/src/Spectre.Console/Prompts/TextPromptExtensions.cs @@ -330,20 +330,15 @@ public static class TextPromptExtensions /// /// The prompt result type. /// The prompt. - /// The default value style. + /// The default value style or to use the default style (green). /// The same instance so that multiple calls can be chained. - public static TextPrompt DefaultValueStyle(this TextPrompt obj, Style style) + public static TextPrompt DefaultValueStyle(this TextPrompt obj, Style? style) { if (obj is null) { throw new ArgumentNullException(nameof(obj)); } - if (style is null) - { - throw new ArgumentNullException(nameof(style)); - } - obj.DefaultValueStyle = style; return obj; } @@ -353,20 +348,15 @@ public static class TextPromptExtensions /// /// The prompt result type. /// The prompt. - /// The style to use for displaying the choices. + /// The style to use for displaying the choices or to use the default style (blue). /// The same instance so that multiple calls can be chained. - public static TextPrompt ChoicesStyle(this TextPrompt obj, Style style) + public static TextPrompt ChoicesStyle(this TextPrompt obj, Style? style) { if (obj is null) { throw new ArgumentNullException(nameof(obj)); } - if (style is null) - { - throw new ArgumentNullException(nameof(style)); - } - obj.ChoicesStyle = style; return obj; }