I've inspected the Java class documentation for Color and found that I can generate a Color object from a hex code string (e.g. "#FFFFFF")
using the Color.decode();
method.
I would like to implement the reverse process for a project I am working on, but there doesn't seem to be a method already built in to the class for this.
Is there an easy way to do this?
The masking is used for removing the alpha component, in bits 24-31
There is another way. Thought I just add this alternative.
Read this: Getting Html color codes with a JColorChooser
The answer has a method to convert a color to it's hex value.