mirror of
https://github.com/spectreconsole/spectre.console.git
synced 2025-10-25 15:19:23 +00:00
Removed the verbs from all extension methods that manipulate properties which makes the API more succinct and easier to read. Also added implicit conversion from string to Style. As a good OSS citizen, I've obsoleted the old methods with a warning for now, so this shouldn't break anyone using the old methods.
16 lines
344 B
C#
16 lines
344 B
C#
namespace Spectre.Console.Tests
|
|
{
|
|
internal static class StyleExtensions
|
|
{
|
|
public static Style SetColor(this Style style, Color color, bool foreground)
|
|
{
|
|
if (foreground)
|
|
{
|
|
return style.Foreground(color);
|
|
}
|
|
|
|
return style.Background(color);
|
|
}
|
|
}
|
|
}
|