mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
ColorEdit: Fixed not being able to pass the ImGuiColorEditFlags_NoAlpha or ImGuiColorEditFlags_HDR flags to SetColorEditOptions(). Demo tweak.
This commit is contained in:
@ -983,13 +983,12 @@ void ImGui::ShowDemoWindow(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::Text("Programmatically set defaults:");
|
||||
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"))
|
||||
ImGui::SetColorEditOptions(ImGuiColorEditFlags_Float | ImGuiColorEditFlags_RGB);
|
||||
if (ImGui::Button("Default: Uint8 + HSV + Hue Bar"))
|
||||
ImGui::SetColorEditOptions(ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_HSV | ImGuiColorEditFlags_PickerHueBar);
|
||||
if (ImGui::Button("Default: Float + HDR + Hue Wheel"))
|
||||
ImGui::SetColorEditOptions(ImGuiColorEditFlags_Float | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_PickerHueWheel);
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
Reference in New Issue
Block a user