namespace Spectre.Console;
///
/// Contains extension methods for .
///
public static class TextPathExtensions
{
///
/// Sets the separator style.
///
/// The path.
/// The separator style to set.
/// The same instance so that multiple calls can be chained.
public static TextPath SeparatorStyle(this TextPath obj, Style style)
{
if (obj is null)
{
throw new ArgumentNullException(nameof(obj));
}
obj.SeparatorStyle = style;
return obj;
}
///
/// Sets the separator color.
///
/// The path.
/// The separator color.
/// The same instance so that multiple calls can be chained.
public static TextPath SeparatorColor(this TextPath obj, Color color)
{
return SeparatorStyle(obj, new Style(foreground: color));
}
///
/// Sets the root style.
///
/// The path.
/// The root style to set.
/// The same instance so that multiple calls can be chained.
public static TextPath RootStyle(this TextPath obj, Style style)
{
if (obj is null)
{
throw new ArgumentNullException(nameof(obj));
}
obj.RootStyle = style;
return obj;
}
///
/// Sets the root color.
///
/// The path.
/// The root color.
/// The same instance so that multiple calls can be chained.
public static TextPath RootColor(this TextPath obj, Color color)
{
return RootStyle(obj, new Style(foreground: color));
}
///
/// Sets the stem style.
///
/// The path.
/// The stem style to set.
/// The same instance so that multiple calls can be chained.
public static TextPath StemStyle(this TextPath obj, Style style)
{
if (obj is null)
{
throw new ArgumentNullException(nameof(obj));
}
obj.StemStyle = style;
return obj;
}
///
/// Sets the stem color.
///
/// The path.
/// The stem color.
/// The same instance so that multiple calls can be chained.
public static TextPath StemColor(this TextPath obj, Color color)
{
return StemStyle(obj, new Style(foreground: color));
}
///
/// Sets the leaf style.
///
/// The path.
/// The stem leaf to set.
/// The same instance so that multiple calls can be chained.
public static TextPath LeafStyle(this TextPath obj, Style style)
{
if (obj is null)
{
throw new ArgumentNullException(nameof(obj));
}
obj.LeafStyle = style;
return obj;
}
///
/// Sets the leaf color.
///
/// The path.
/// The leaf color.
/// The same instance so that multiple calls can be chained.
public static TextPath LeafColor(this TextPath obj, Color color)
{
return LeafStyle(obj, new Style(foreground: color));
}
}