mirror of
https://github.com/BlueMap-Minecraft/BlueMapAPI.git
synced 2024-11-14 14:25:18 +01:00
Add constructor with int-alpha (0-255)
This commit is contained in:
parent
3bbf92965d
commit
49b51f400d
@ -77,6 +77,15 @@ public Color(int i, float alpha) {
|
||||
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 # <i>(css-style: e.g. <code>#f16</code> becomes <code>#ff1166</code>)</i>.
|
||||
|
Loading…
Reference in New Issue
Block a user