Rename ImColor methods
This commit is contained in:
1 parent
1e95024702
commit
2ba2216957
2 files changed
+14
-14
No files matched your search
@@ -7,27 +7,27 @@ public final class ImColor {
|
||||
private ImColor() {
|
||||
}
|
||||
|
||||
public static int get32(final int r, final int g, final int b, final int a) {
|
||||
public static int intToColor(final int r, final int g, final int b, final int a) {
|
||||
return a << 24 | b << 16 | g << 8 | r;
|
||||
}
|
||||
|
||||
public static int get32(final int r, final int g, final int b) {
|
||||
return get32(r, g, b, 255);
|
||||
public static int intToColor(final int r, final int g, final int b) {
|
||||
return intToColor(r, g, b, 255);
|
||||
}
|
||||
|
||||
public static int get32(final float r, final float g, final float b, final float a) {
|
||||
return get32((int) (r * 255), (int) (g * 255), (int) (b * 255), (int) (a * 255));
|
||||
public static int floatToColor(final float r, final float g, final float b, final float a) {
|
||||
return intToColor((int) (r * 255), (int) (g * 255), (int) (b * 255), (int) (a * 255));
|
||||
}
|
||||
|
||||
public static int get32(final float r, final float g, final float b) {
|
||||
return get32(r, g, b, 1f);
|
||||
public static int floatToColor(final float r, final float g, final float b) {
|
||||
return floatToColor(r, g, b, 1f);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param hex e.g. "#FFFFFF"
|
||||
*/
|
||||
public static int get32RGBHex(final String hex) {
|
||||
return get32(
|
||||
public static int rgbToColor(final String hex) {
|
||||
return intToColor(
|
||||
Integer.parseInt(hex.substring(1, 3), 16),
|
||||
Integer.parseInt(hex.substring(3, 5), 16),
|
||||
Integer.parseInt(hex.substring(5, 7), 16)
|
||||
@@ -37,8 +37,8 @@ public final class ImColor {
|
||||
/**
|
||||
* @param hex e.g. "#FFFFFFFF"
|
||||
*/
|
||||
public static int get32RGBAHex(final String hex) {
|
||||
return get32(
|
||||
public static int rgbaToColor(final String hex) {
|
||||
return intToColor(
|
||||
Integer.parseInt(hex.substring(1, 3), 16),
|
||||
Integer.parseInt(hex.substring(3, 5), 16),
|
||||
Integer.parseInt(hex.substring(5, 7), 16),
|
||||
|
||||
Reference in new issue
Block a user