public static System.Windows.Media.Color ToSystemWindowsMediaColor(this ColorSpace colorSpace) { if (colorSpace is Rgba rgba) { return(Color.FromArgb((byte)rgba.A, (byte)rgba.R, (byte)rgba.G, (byte)rgba.B)); } else { var rgb = colorSpace.ToColorSpace <Rgb>(); return(Color.FromRgb((byte)rgb.R, (byte)rgb.G, (byte)rgb.B)); } }