Skip to content

Commit 8571a01

Browse files
committed
Add methods to provide and get separate ImGuiStyle.Colors values
1 parent aed7287 commit 8571a01

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

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

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,9 @@ public final class ImGuiStyle {
422422
ImGui::GetStyle().CircleSegmentMaxError = circleSegmentMaxError;
423423
*/
424424

425-
// Colors
426-
// BINDING NOTICE: buff is a 2d array with sizes: [ImGuiCol_COUNT][4]
427-
//
425+
/**
426+
* BINDING NOTICE: colors is a 2d array with sizes: [ImGuiCol_COUNT][4]
427+
*/
428428
public native void getColors(float[][] buff); /*
429429
for (int i = 0; i < ImGuiCol_COUNT; i++) {
430430
jfloatArray jColors = (jfloatArray)env->GetObjectArrayElement(buff, i);
@@ -440,8 +440,9 @@ public final class ImGuiStyle {
440440
}
441441
*/
442442

443-
// BINDING NOTICE: colors is a 2d array with sizes: [ImGuiCol_COUNT][4]
444-
//
443+
/**
444+
* BINDING NOTICE: colors is a 2d array with sizes: [ImGuiCol_COUNT][4]
445+
*/
445446
public native void setColors(float[][] colors); /*
446447
for (int i = 0; i < ImGuiCol_COUNT; i++) {
447448
jfloatArray jColors = (jfloatArray)env->GetObjectArrayElement(colors, i);
@@ -460,4 +461,12 @@ public final class ImGuiStyle {
460461
public native void scaleAllSizes(float scaleFactor); /*
461462
ImGui::GetStyle().ScaleAllSizes(scaleFactor);
462463
*/
464+
465+
public native void getColor(int imGuiCol, ImVec4 dstImVec4); /*
466+
Jni::ImVec4Cpy(env, ImGui::GetStyle().Colors[imGuiCol], dstImVec4);
467+
*/
468+
469+
public native void setColor(int imGuiCol, float r, float g, float b, float a); /*
470+
ImGui::GetStyle().Colors[imGuiCol] = ImVec4(r, g, b, a);
471+
*/
463472
}

0 commit comments

Comments
 (0)