Suppose I have an enum:
enum Color {Red = 1, Green, Blue};
If I have a number, I can get the enum key by doing this:
var colorName: string = Color[2]; // colorName = "Green"
However, that gives me a string. How can I make it so that I get a variable of type Color instead? i.e.:
colorName : Color == Color.Green