mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Added SetColorEditOptions(). ColorPicker4: context menu to select picker type and alpha bar. Reorganized flags (again!). (#346)
This commit is contained in:
parent
d952a8d3bf
commit
942cb0e1f2
4 changed files with 151 additions and 71 deletions
|
|
@ -776,6 +776,14 @@ void ImGui::ShowTestWindow(bool* p_open)
|
|||
if (inputs_mode == 4) flags |= ImGuiColorEditFlags_HEX;
|
||||
ImGui::ColorPicker4("MyColor##4", (float*)&color, flags, ref_color ? &ref_color_v.x : NULL);
|
||||
|
||||
ImGui::Text("Programmatically set defaults/options:");
|
||||
ImGui::SameLine(); ShowHelpMarker("SetColorEditOptions() is designed to allow you to set boot-time default.\nWe don't have Push/Pop functions because you can force options on a per-widget basis if needed, and the user can change non-forced ones with the options menu.\nWe don't have a getter to avoid encouraging you to persistently save values that aren't forward-compatible.");
|
||||
if (ImGui::Button("Uint8 + HSV"))
|
||||
ImGui::SetColorEditOptions(ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_HSV);
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Float + HDR + NoClamp"))
|
||||
ImGui::SetColorEditOptions(ImGuiColorEditFlags_Float | ImGuiColorEditFlags_RGB | ImGuiColorEditFlags_HDR);
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue