Same color - CSharp System.Drawing

CSharp examples for System.Drawing:Color

Description

Same color

Demo Code


using System.Text;
using System.Collections.Generic;
using System;/*from  ww  w . j a v a  2s.  c  om*/
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

public class Main{
      /// <summary>
      /// Same color. Helper method for LoadLevel because for some reason
      /// the color compare does not work and causes a lot of errors.
      /// </summary>
      /// <param name="color">Color</param>
      /// <param name="checkColor">Check color</param>
      /// <returns>Bool</returns>
      public static bool SameColor(Color color, Color checkColor)
      {
         return color.R == checkColor.R &&
            color.G == checkColor.G &&
            color.B == checkColor.B;
      } // SameColor(color, checkColor)
}

Related Tutorials