public static Color getColorProperty ( String key , boolean required ) { Color value = null ; String redProperty = key + JavaPropertyConstants . PROPERTY_DIVIDER + JavaPropertyConstants . COLOR_RED ; String greenProperty = key + JavaPropertyConstants . PROPERTY_DIVIDER + JavaPropertyConstants . COLOR_GREEN ; String blueProperty = key + JavaPropertyConstants . PROPERTY_DIVIDER + JavaPropertyConstants . COLOR_BLUE ; String alphaProperty = key + JavaPropertyConstants . PROPERTY_DIVIDER + JavaPropertyConstants . COLOR_ALPHA ; Integer red = getIntegerProperty ( redProperty , required ) ; Integer green = getIntegerProperty ( greenProperty , required ) ; Integer blue = getIntegerProperty ( blueProperty , required ) ; Integer alpha = getIntegerProperty ( alphaProperty , required ) ; if ( red != null && green != null && blue != null && alpha != null ) { value = new Color ( red , green , blue , alpha ) ; } return value ; }
Get a color by key