Closed moebiussurfing closed 4 years ago
Ok. I see how to do it:
// ImGui::ColorEdit3("Background Color", (float*)&backgroundColor);
ImGui::ColorPicker3("Background Color", (float*)&backgroundColor);
also you can set some settings of the color picker like this:
ImGuiColorEditFlags_AlphaBar |
ImGuiColorEditFlags_AlphaPreview |
ImGuiColorEditFlags_HSV |
ImGuiColorEditFlags_PickerHueWheel;
ImGui::ColorPicker4("Background Color", (float*)&backgroundColor, colorEdiFlags);
all the available settings can be found here in imgui.h
:
// Enumeration for ColorEdit3() / ColorEdit4() / ColorPicker3() / ColorPicker4() / ColorButton()
enum ImGuiColorEditFlags_
{
ImGuiColorEditFlags_None = 0,
ImGuiColorEditFlags_NoAlpha = 1 << 1, // // ColorEdit, ColorPicker, ColorButton: ignore Alpha component (read 3 components from the input pointer).
ImGuiColorEditFlags_NoPicker = 1 << 2, //
...
ofxImGui::AddParameter(this->color_picked, true);
When we click on a color widget the color picker wheel it opens his window. Then when right-clicking it open both modes: rectangle or triangle controllers.We can change from RGB number setters to HSV, so maybe there is a nice way to add HSV "direct (not external)" float sliders without overflow the callbacks..
How we can show a picker on the panel to show by default? So we don't need to click to open?
(Also would be nice to get the position (or where/how it opens) to recall on settings.)