I have this Enum:
enum ASCIIChars
{
BLACK = "@",
CHARCOAL = "#",
DARKGRAY = "8",
MEDIUMGRAY = "&",
MEDIUM = "o",
GRAY = ":",
SLATEGRAY = "*",
LIGHTGRAY = ".",
WHITE = " "
};
Here is where I am using it:
private void GetShadeColor(int redValue)
{
string ASCII = " ";
if (redValue >= 230)
{
ASCII = ASCIIChars.WHITE;
}
else if (redValue >= 200)
{
ASCII = ASCIIChars.LIGHTGRAY;
}
else if (redValue >= 180)
{
ASCII = ASCIIChars.SLATEGRAY;
}
else if (redValue >= 160)
{
ASCII = ASCIIChars.GRAY;
}
else if (redValue >= 130)
{
ASCII = ASCIIChars.MEDIUM;
}
else if (redValue >= 100)
{
ASCII = ASCIIChars.MEDIUMGRAY;
}
else if (redValue >= 70)
{
ASCII = ASCIIChars.DARKGRAY;
}
else if (redValue >= 50)
{
ASCII = ASCIIChars.CHARCOAL;
}
else
{
ASCII = ASCIIChars.BLACK;
}
ASCIIArt.Append(ASCII);
}
I'm getting the following errors in the enum declaration:
Cannot implicitly convert string to int.