Patrik Svensson 98cf63f485 Rename Style and Appearance
* Renames Style -> Decoration
* Renames Appearance -> Style
* Adds Style.Parse and Style.TryParse
2020-08-03 23:30:47 +02:00

30 lines
638 B
C#

using System;
using System.Collections.Generic;
namespace Spectre.Console.Internal
{
internal static class StyleExtensions
{
public static Style Combine(this Style style, IEnumerable<Style> source)
{
if (style is null)
{
throw new ArgumentNullException(nameof(style));
}
if (source is null)
{
return style;
}
var current = style;
foreach (var item in source)
{
current = current.Combine(item);
}
return current;
}
}
}