Even with Console.ResetColor(); it still doesn't reset after the last line
if (Total >= 15)
{
Console.BackgroundColor = ConsoleColor.Green;
Console.WriteLine("You win");
if (Total - 15 == 0)
{
Console.WriteLine("You won without any extra points, :)");
}
else
{
Console.WriteLine($"You won with {Total - 15} extra points, :)");
}
Console.ResetColor();
}
else
{
Console.BackgroundColor = ConsoleColor.Red;
Console.WriteLine("You lost");
Console.WriteLine($"You were {15 - Total} points away, :(");
Console.ResetColor();
}
Console.BackgroundColor = ConsoleColor.Black;
Console.ResetColor();
Resetting the color on the if statements apart and also changing the background color to black but does nothing as well.
Tested in the PowerShell terminal if that helps.
Try this one