diff --git a/src/client/spark/view/Extensions/WPFExtensions.cs b/src/client/spark/view/Extensions/WPFExtensions.cs index 0297e803e..cfddba232 100644 --- a/src/client/spark/view/Extensions/WPFExtensions.cs +++ b/src/client/spark/view/Extensions/WPFExtensions.cs @@ -66,11 +66,18 @@ namespace mbts.ui { } } + // TODO: replace this method with 'argb_color' + // - before that, need to verify that no settings/colors become 'invisible' as a result. public static Color rgb_color(this UInt32 color) { var bytes = BitConverter.GetBytes(color); return Color.FromRgb(bytes[2], bytes[1], bytes[0]); } + public static Color argb_color(this uint color) { + var bytes = BitConverter.GetBytes(color); + return Color.FromArgb(bytes[3], bytes[2], bytes[1], bytes[0]); + } + public static SolidColorBrush to_brush(this BTSColor color) => new SolidColorBrush(color); @@ -103,6 +110,9 @@ namespace mbts.ui { return brush; } + public static Color with(this Color color, byte alpha) => + Color.FromArgb(alpha, color.R, color.G, color.B); + public static SolidColorBrush with(this SolidColorBrush brush, double opacity) { brush.Opacity = opacity; return brush;