public static Color GetBlackness(int x, int y)
{
int index1 = x - Lighting.firstTileX + Lighting.offScreenTiles;
int index2 = y - Lighting.firstTileY + Lighting.offScreenTiles;
if (index1 < 0 || index2 < 0 || (index1 >= Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 || index2 >= Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10))
return Color.Black;
return new Color(0, 0, 0, (int)(byte)((double)byte.MaxValue - (double)byte.MaxValue * (double)Lighting.states[index1][index2].r));
}