Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public bool Equals(RGBColor other)
 {
     if (other == null) throw new ArgumentNullException("other");
     return base.Equals(other) && WorkingSpace.Equals(other.WorkingSpace);
 }
Exemplo n.º 3
0
 public static Color ToColor(this RGBColor c)
 {
     return(new Color((float)c.R, (float)c.G, (float)c.B));
 }
Exemplo n.º 4
0
 public bool Equals(RGBColor other) =>
 R == other.R &&
 G == other.G &&
 B == other.B &&
 WorkingSpace.Equals(other.WorkingSpace);