/** * Parse a color from a string, combine it with separately defined alpha and return * it. In the case of an error this function will return the color white. * * @param color * The color definition in string form. * @param alpha * The alpha value (0-255) in int form. * * @return * The interpreted color or a default of white. */ public static Color getColorWithAlpha (String color, int alpha) { return getColorWithAlpha(color, alpha, Color.WHITE); }
colors.add(ColorRampParameter.getColorWithAlpha(color, alpha));
int alpha1 = getPropertyValue(ALPHA1); if (-1 == alpha1) alpha1 = (int) Math.floor(255*opacity); Color startColor = ColorRampParameter.getColorWithAlpha(getPropertyValue(COLOR1), alpha1); int alpha2 = getPropertyValue(ALPHA2); if (-1 == alpha2) alpha2 = (int) Math.floor(255*opacity); Color endColor = ColorRampParameter.getColorWithAlpha(getPropertyValue(COLOR2), alpha2); ramp = new SingleGradientColorRamp(startColor, endColor);