/// <summary> /// Creates a <see cref="ColoredString"/> object from an existing string with the specified foreground, background, and cell effect. /// </summary> /// <param name="value">The current string.</param> /// <param name="foreground">The foreground color.</param> /// <param name="background">The background color.</param> /// <param name="effect">The cell effect.</param> /// <returns>A <see cref="ColoredString"/> object instace.</returns> public static ColoredString CreateColored(this string value, Color foreground, Color background, ICellEffect effect) { ColoredString newString = new ColoredString(value); newString.Foreground = foreground; newString.Background = background; newString.Effect = effect; newString.UpdateWithDefaults(); return(newString); }
/// <summary> /// Creates a <see cref="ColoredString"/> object from an existing string with the specified foreground, background, and cell effect. /// </summary> /// <param name="value">The current string.</param> /// <param name="appearance">The foreground and background color.</param> /// <param name="effect">The cell effect.</param> /// <returns>A <see cref="ColoredString"/> object instace.</returns> public static ColoredString CreateColored(this string value, ICellAppearance appearance, ICellEffect effect) { ColoredString newString = new ColoredString(value); newString.Foreground = appearance.Foreground; newString.Background = appearance.Background; newString.Effect = effect; newString.UpdateWithDefaults(); return(newString); }