ChessBoardVisualLib.ViewModel.SquareItem.SetBackgroundColor C# (CSharp) Method

SetBackgroundColor() public method

public SetBackgroundColor ( Square square ) : void
square Square
return void
        public void SetBackgroundColor(Square square)
        {
            int file = (int)BitBoardHelper.GetFileFromSquare(square);
            int rank = BitBoardHelper.GetRankFromSquare(square);

            if (0 == ((7 - file) + rank) % 2)
                this.SquareColor = Color.White;
            else
                this.SquareColor = Color.Black;
        }