We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3bbf929 commit 49b51f4Copy full SHA for 49b51f4
src/main/java/de/bluecolored/bluemap/api/math/Color.java
@@ -77,6 +77,15 @@ public Color(int i, float alpha) {
77
this((i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF, alpha);
78
}
79
80
+ /**
81
+ * Creates a new color from the given integer in the format 0xRRGGBB.
82
+ * @param i the integer to create the color from
83
+ * @param alpha the alpha value in range 0-255
84
+ */
85
+ public Color(int i, int alpha) {
86
+ this((i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF, (float) alpha / 255f);
87
+ }
88
+
89
/**
90
* The value can be an integer in String-Format (see {@link #Color(int)}) or a string in hexadecimal format
91
* prefixed with # <i>(css-style: e.g. <code>#f16</code> becomes <code>#ff1166</code>)</i>.
0 commit comments