Illegal reference to static field colorMap inside of the constructor
Enum constructors cannot access the enum static fields. However, they can invoke the enum’s static methods that access the static fields. The problem is static initialization has not been done at the time the enum constructor constant constructors are invoked, so using static methods will just see zeros. Constructors can also directly access static final in-lineable constants known at compile time.
Static variables have to be assigned to their values when a class is first called. That is called static initialization.
You may therefore try to access the static field inside the constructor, but... (
hint: you will only get a NullPointerException)