Skip to content

Commit 75dfff3

Browse files
committed
remove color rgba methods to avoid confusion
1 parent 5af9d83 commit 75dfff3

File tree

1 file changed

+2
-16
lines changed
  • src/main/java/com/cleanroommc/modularui/utils

1 file changed

+2
-16
lines changed

src/main/java/com/cleanroommc/modularui/utils/Color.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
/**
1717
* 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>
1919
* Most of the conversion methods are written by me with the help of <a href=https://www.rapidtables.com/convert/color/>this website</a>.
2020
*
2121
* @author brachy
@@ -43,20 +43,6 @@ public static int argb(float red, float green, float blue, float alpha) {
4343
return argb((int) (red * 255), (int) (green * 255), (int) (blue * 255), (int) (alpha * 255));
4444
}
4545

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-
6046
/**
6147
* Creates a color int. All values should be 0 - 1
6248
*/
@@ -629,7 +615,7 @@ public static int rgbaToArgb(int rgba) {
629615
* @return RGBA color
630616
*/
631617
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));
633619
}
634620

635621
/**

0 commit comments

Comments
 (0)