Ignore:
Timestamp:
2017-03-05T17:31:39+01:00 (3 years ago)
Author:
michael2402
Message:

Repsect alpha component of mapcss text/halo color, use opacity to multiply.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r11493 r11692  
    295295
    296296    /**
     297     * Multiply the alpha value of the given color with the factor. The alpha value is clamped to 0..255
     298     * @param color The color
     299     * @param alphaFactor The factor to multiply alpha with.
     300     * @return The new color.
     301     * @since 11692
     302     */
     303    public static Color alphaMultiply(Color color, float alphaFactor) {
     304        int alpha = Utils.colorFloat2int(Utils.colorInt2float(color.getAlpha()) * alphaFactor);
     305        alpha = clamp(alpha, 0, 255);
     306        return new Color(color.getRed(), color.getGreen(), color.getBlue(), alpha);
     307    }
     308
     309    /**
    297310     * Returns the complementary color of {@code clr}.
    298311     * @param clr the color to complement
Note: See TracChangeset for help on using the changeset viewer.