/// <summary> /// Converts <paramref name="self"/> to a <see cref="HighlightingColor"/> instance or null /// if input is null /// </summary> /// <param name="self">This</param> /// <returns></returns> public static HighlightingColor ToHighlightingColor(this IThemeColor self) { if (self == null) { return(null); } var hl = new HighlightingColor { Name = self.Name, FontWeight = self.FontWeight, FontStyle = self.FontStyle, Underline = null, Foreground = MyHighlightingBrush.Create(self.Foreground), Background = MyHighlightingBrush.Create(self.Background), }; hl.Freeze(); return(hl); }
/// <summary> /// Creates a <see cref="HighlightingBrush"/> or returns null if input is null /// </summary> /// <param name="brush">Brush</param> /// <returns></returns> public static HighlightingBrush ToHighlightingBrush(this Brush brush) { return(MyHighlightingBrush.Create(brush)); }