In order to save Color attributes of a graphical object in my application, I saved the string representation of this Color in a data file.
For instance, for red I save: java.awt.Color[r=255,g=0,b=0].
How can I convert this string representation into a Color so that I can use it again after loading my data file ?
Thank you.
Using
toString()“might vary between implementations.” Instead saveString.valueOf(color.getRGB())for later reconstruction.