|
15 | 15 |
|
16 | 16 | /** |
17 | 17 | * Utility class for dealing with colors. |
18 | | - * <b>All methods assume the color int to be AARRGGBB if not stated otherwise!</b> |
| 18 | + * <b>All methods assume the color int to be AARRGGBB!</b> |
19 | 19 | * Most of the conversion methods are written by me with the help of <a href=https://www.rapidtables.com/convert/color/>this website</a>. |
20 | 20 | * |
21 | 21 | * @author brachy |
@@ -43,20 +43,6 @@ public static int argb(float red, float green, float blue, float alpha) { |
43 | 43 | return argb((int) (red * 255), (int) (green * 255), (int) (blue * 255), (int) (alpha * 255)); |
44 | 44 | } |
45 | 45 |
|
46 | | - /** |
47 | | - * Creates a color int. All values should be 0 - 255 |
48 | | - */ |
49 | | - public static int rgba(int red, int green, int blue, int alpha) { |
50 | | - return ((red & 0xFF) << 24) | ((green & 0xFF) << 16) | ((blue & 0xFF) << 8) | (alpha & 0xFF); |
51 | | - } |
52 | | - |
53 | | - /** |
54 | | - * Creates a color int. All values should be 0 - 1 |
55 | | - */ |
56 | | - public static int rgba(float red, float green, float blue, float alpha) { |
57 | | - return rgba((int) (red * 255), (int) (green * 255), (int) (blue * 255), (int) (alpha * 255)); |
58 | | - } |
59 | | - |
60 | 46 | /** |
61 | 47 | * Creates a color int. All values should be 0 - 1 |
62 | 48 | */ |
@@ -629,7 +615,7 @@ public static int rgbaToArgb(int rgba) { |
629 | 615 | * @return RGBA color |
630 | 616 | */ |
631 | 617 | public static int argbToRgba(int argb) { |
632 | | - return Color.rgba(getRed(argb), getGreen(argb), getBlue(argb), getAlpha(argb)); |
| 618 | + return argb(getGreen(argb), getBlue(argb), getAlpha(argb), getRed(argb)); |
633 | 619 | } |
634 | 620 |
|
635 | 621 | /** |
|
0 commit comments