private void UpdateScore() { WhiteScore = board.GetWhiteScore(); BlackScore = board.GetBlackScore(); byte gray = (byte)(0.2 + (WhiteScore * 0.8 / (double)(WhiteScore + BlackScore)) * 255); bgBoard.Fill = new SolidColorBrush(Color.FromRgb(gray, gray, gray)); }