public static Color ToColor(this RGBColor input) { if (input == null) { return(new Color()); } var r = (byte)Math.Round(input.R * 255).CropRange(0, 255); var g = (byte)Math.Round(input.G * 255).CropRange(0, 255); var b = (byte)Math.Round(input.B * 255).CropRange(0, 255); var output = Color.FromArgb(r, g, b); return(output); }
public bool Equals(RGBColor other) { if (other == null) throw new ArgumentNullException("other"); return base.Equals(other) && WorkingSpace.Equals(other.WorkingSpace); }
public static Color ToColor(this RGBColor c) { return(new Color((float)c.R, (float)c.G, (float)c.B)); }
public bool Equals(RGBColor other) => R == other.R && G == other.G && B == other.B && WorkingSpace.Equals(other.WorkingSpace);