Hi all,
Is it possible to specify a color in a properties file that has an alpha component? When I put a hexadecimal number in the properties file that has an alpha channel, the alpha is ignored. I notice that the decode method of string says "Converts a String to an integer and returns the specified opaque Color.", and that the only single argument constructor that takes in an int or hexadecimal number also says that it's an opaque color. What is the best practice in this regard?
The alternatives I see are to have something like
component.color.red=128
component.color.green=25
component.color.blue=54
component.color.alpha=244
or
component.color=128_25_54_244
and then manually splitting up the string into its constituent RGBA components. Neither of these solutions looks very appealing to me.
I remember at one time I saw an alternative properties project, I think for swingx, that had better support for colors. Does anyone know what that was, and whether it could solve my problem?
EDIT:
As I say in the comments to one of the posts, I want a solution where I can specify colors in whatever means I want in the properties file (hexadecimal for opaque colors, signed integer for translucent) and not have to change the source code that deals with interpreting the key/value pairs for the color.
Second Edit: The library I was talking about is Fuse, which is a resource injection framework for GUI programming.