I would like to save in a config a ChatColor, which is placed there by command in there but how do I know if the string, which has entered the CommandSender.
Does anyone have an idea?
As can be seen from Spigot's https://hub.spigotmc.org/...Color.html, ChatColor is an enum. Among other things, it has the method valueOf (String name).
Meaning you can just do something like:
String colorName = "blue";
ChatColor color = ChatColor.valueOf (colorName.toUpperCase ());
You can then cache the string colorName somewhere. (I wrote the string extra small to bring toUpperCase () in. That gives you a bit more security than just keeping in mind that you need to capitalize on colors everywhere.)
Note that "more complex" colors, ie colors with an underscore in the name, must also have one in the string. So if you have an input from a user who typed in "dark blue" for example, you not only have to make toUpperCase (), but also replaceAll ("", "_") o.A.
Thank you