diff --git a/src/main/java/de/bluecolored/bluemap/api/math/Color.java b/src/main/java/de/bluecolored/bluemap/api/math/Color.java index 681e79b..6d9f884 100644 --- a/src/main/java/de/bluecolored/bluemap/api/math/Color.java +++ b/src/main/java/de/bluecolored/bluemap/api/math/Color.java @@ -77,6 +77,15 @@ public class Color { this((i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF, alpha); } + /** + * Creates a new color from the given integer in the format 0xRRGGBB. + * @param i the integer to create the color from + * @param alpha the alpha value in range 0-255 + */ + public Color(int i, int alpha) { + this((i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF, (float) alpha / 255f); + } + /** * The value can be an integer in String-Format (see {@link #Color(int)}) or a string in hexadecimal format * prefixed with # (css-style: e.g. #f16 becomes #ff1166).