Skip to content

Commit 2ba2216

Browse files
committed
Rename ImColor methods
1 parent 1e95024 commit 2ba2216

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

imgui-binding/src/main/java/imgui/ImColor.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@ public final class ImColor {
77
private ImColor() {
88
}
99

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) {
1111
return a << 24 | b << 16 | g << 8 | r;
1212
}
1313

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);
1616
}
1717

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));
2020
}
2121

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);
2424
}
2525

2626
/**
2727
* @param hex e.g. "#FFFFFF"
2828
*/
29-
public static int get32RGBHex(final String hex) {
30-
return get32(
29+
public static int rgbToColor(final String hex) {
30+
return intToColor(
3131
Integer.parseInt(hex.substring(1, 3), 16),
3232
Integer.parseInt(hex.substring(3, 5), 16),
3333
Integer.parseInt(hex.substring(5, 7), 16)
@@ -37,8 +37,8 @@ public static int get32RGBHex(final String hex) {
3737
/**
3838
* @param hex e.g. "#FFFFFFFF"
3939
*/
40-
public static int get32RGBAHex(final String hex) {
41-
return get32(
40+
public static int rgbaToColor(final String hex) {
41+
return intToColor(
4242
Integer.parseInt(hex.substring(1, 3), 16),
4343
Integer.parseInt(hex.substring(3, 5), 16),
4444
Integer.parseInt(hex.substring(5, 7), 16),

imgui-lwjgl3/src/test/java/ExampleUi.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
final class ExampleUi {
2020
private static final String IMGUI_DEMO_LINK = "https://raw.githubusercontent.com/ocornut/imgui/v1.76/imgui_demo.cpp";
2121

22-
private static final int DODGERBLUE_COLOR = ImColor.get32RGBHex("#1E90FF");
23-
private static final int CORAL_COLOR = ImColor.get32RGBHex("#FF7F50");
24-
private static final int LIMEGREEN_COLOR = ImColor.get32RGBHex("#32CD32");
22+
private static final int DODGERBLUE_COLOR = ImColor.rgbToColor("#1E90FF");
23+
private static final int CORAL_COLOR = ImColor.rgbToColor("#FF7F50");
24+
private static final int LIMEGREEN_COLOR = ImColor.rgbToColor("#32CD32");
2525

2626
// Test data for payload
2727
private final byte[] testPayload = "Test Payload".getBytes();

0 commit comments

Comments
 (0)