Cant figure out approach to grid issue

I cant think of a way to achieve what I am after. I am trying to color all the points left of the red line ,black (See image). Here is a snippet of how I am currently applying the colors.

69002-diag.jpg

        int halfway = (int)((tileResolution * gridSize) / 2);
        for (int y = 0; y< (int)(tileResolution* gridSize); y++)
        {
            for (int x = 0; x< (int)(tileResolution* gridSize); x++)
            {
                if (x >= halfway && y >= halfway) 
                {                            
                    tex.SetPixel(x, y, Color.white);
                }
                else {
                    tex.SetPixel(x, y, Color.black);
                }
            } 
        }

I did think of a possibility but even so, I cant think of a way to implement it.

69004-ide.jpg

Hopefully someone has some ideas! Thanks

If you’re not worried about versatility, that diagonal line should be able to be made by adding the x and y values together rather than testing each separately.

In this case, X + Y would give you 1.5x the dimensions together.

int target = (int)((tileResolution * gridSize) * 1.5f);
for (int y = 0; y< (int)(tileResolution* gridSize); y++)
{
     for (int x = 0; x< (int)(tileResolution* gridSize); x++)
     {
         if (x + y > target) 
         {                            
             tex.SetPixel(x, y, Color.white);
         }
         else {
             tex.SetPixel(x, y, Color.black);
         }
     } 
 }