/// <summary> /// Return a <see cref="string"/> representation of a given <see cref="Color"/> /// </summary> /// <param name="color">The <see cref="Color"/> for the presentation</param> /// <param name="colorRepresentationType">The type of the representation</param> /// <returns>A <see cref="string"/> representation of a color</returns> internal static string GetStringRepresentationFromMediaColor(System.Windows.Media.Color color, ColorRepresentationType colorRepresentationType) { var drawingcolor = Color.FromArgb(color.A, color.R, color.G, color.B); return(GetStringRepresentation(drawingcolor, colorRepresentationType)); }
/// <summary> /// Return a <see cref="string"/> representation of a given <see cref="Color"/> /// </summary> /// <param name="color">The <see cref="Color"/> for the presentation</param> /// <param name="colorRepresentationType">The type of the representation</param> /// <returns>A <see cref="string"/> representation of a color</returns> internal static string GetStringRepresentation(Color color, ColorRepresentationType colorRepresentationType) => colorRepresentationType switch {
public void GetStringRepresentationTest(ColorRepresentationType type, string expected) { var result = ColorRepresentationHelper.GetStringRepresentation(Color.Black, type); Assert.AreEqual(result, expected); }