Change color with hex code?
I am trying to write a code to change the color with a hex code. Actually I want to add my own colors instead of "black" "red" and so on. So if I write skyblue it should use "#3398F0".
I am working on the example project of BlueJ. If you use this program you should have it too.
Take a look at the picture. How can I add some different colors?
Re: Change color with hex code?
Take a look at the constructors of java.awt.Color that take int parameters. Also Integer methods that take a String and an int radix.
Alternatively, you can hard-code a Map<String, Color> to do the lookup.