Cairo.Color.Equals C# (CSharp) Метод

Equals() публичный Метод

public Equals ( object obj ) : bool
obj object
Результат bool
        public override bool Equals(object obj)
        {
            Color other = (Color) obj;
            return System.Math.Abs(this.r - other.r) < double.Epsilon
                   && System.Math.Abs(this.g - other.g) < double.Epsilon
                   && System.Math.Abs(this.b - other.b) < double.Epsilon
                   && System.Math.Abs(this.a - other.a) < double.Epsilon;
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Checks if all of the pixels in the column (within the bounds of the rectangle) match the specified color.
        /// </summary>
        private static bool IsConstantColumn(ImageSurface surf, Cairo.Color color, Gdk.Rectangle rect, int x)
        {
            for (int y = rect.Top; y < rect.Bottom; ++y)
            {
                if (!color.Equals(surf.GetPixel(x, y)))
                {
                    return(false);
                }
            }

            return(true);
        }
All Usage Examples Of Cairo.Color::Equals