@@ -7,27 +7,27 @@ public final class ImColor {
7
7
private ImColor () {
8
8
}
9
9
10
- public static int get32 (final int r , final int g , final int b , final int a ) {
10
+ public static int intToColor (final int r , final int g , final int b , final int a ) {
11
11
return a << 24 | b << 16 | g << 8 | r ;
12
12
}
13
13
14
- public static int get32 (final int r , final int g , final int b ) {
15
- return get32 (r , g , b , 255 );
14
+ public static int intToColor (final int r , final int g , final int b ) {
15
+ return intToColor (r , g , b , 255 );
16
16
}
17
17
18
- public static int get32 (final float r , final float g , final float b , final float a ) {
19
- return get32 ((int ) (r * 255 ), (int ) (g * 255 ), (int ) (b * 255 ), (int ) (a * 255 ));
18
+ public static int floatToColor (final float r , final float g , final float b , final float a ) {
19
+ return intToColor ((int ) (r * 255 ), (int ) (g * 255 ), (int ) (b * 255 ), (int ) (a * 255 ));
20
20
}
21
21
22
- public static int get32 (final float r , final float g , final float b ) {
23
- return get32 (r , g , b , 1f );
22
+ public static int floatToColor (final float r , final float g , final float b ) {
23
+ return floatToColor (r , g , b , 1f );
24
24
}
25
25
26
26
/**
27
27
* @param hex e.g. "#FFFFFF"
28
28
*/
29
- public static int get32RGBHex (final String hex ) {
30
- return get32 (
29
+ public static int rgbToColor (final String hex ) {
30
+ return intToColor (
31
31
Integer .parseInt (hex .substring (1 , 3 ), 16 ),
32
32
Integer .parseInt (hex .substring (3 , 5 ), 16 ),
33
33
Integer .parseInt (hex .substring (5 , 7 ), 16 )
@@ -37,8 +37,8 @@ public static int get32RGBHex(final String hex) {
37
37
/**
38
38
* @param hex e.g. "#FFFFFFFF"
39
39
*/
40
- public static int get32RGBAHex (final String hex ) {
41
- return get32 (
40
+ public static int rgbaToColor (final String hex ) {
41
+ return intToColor (
42
42
Integer .parseInt (hex .substring (1 , 3 ), 16 ),
43
43
Integer .parseInt (hex .substring (3 , 5 ), 16 ),
44
44
Integer .parseInt (hex .substring (5 , 7 ), 16 ),
0 commit comments