@ -666,36 +666,36 @@ void ImGui::ShowTestWindow(bool* p_open)
static bool alpha_half_preview = false ;
ImGui : : Checkbox ( " With Alpha Preview " , & alpha_preview ) ;
ImGui : : Checkbox ( " With Half Alpha Preview " , & alpha_half_preview ) ;
int alpha_ flags = alpha_half_preview ? ImGuiColorEditFlags_AlphaPreviewHalf : ( alpha_preview ? ImGuiColorEditFlags_AlphaPreview : 0 ) ;
int alpha_ previw_ flags = alpha_half_preview ? ImGuiColorEditFlags_AlphaPreviewHalf : ( alpha_preview ? ImGuiColorEditFlags_AlphaPreview : 0 ) ;
ImGui : : Text ( " Color widget: " ) ;
ImGui : : SameLine ( ) ; ShowHelpMarker ( " Click on the colored square to open a color picker. \n Right-click on the colored square to show options. \n CTRL+click on individual component to input value. \n " ) ;
ImGui : : ColorEdit3 ( " MyColor##1 " , ( float * ) & color , ImGuiColorEditFlags_HSV ) ;
ImGui : : Text ( " Color widget with Alpha: " ) ;
ImGui : : ColorEdit4 ( " MyColor##2 " , ( float * ) & color , alpha_ flags) ;
ImGui : : ColorEdit4 ( " MyColor##2 " , ( float * ) & color , alpha_ previw_ flags) ;
ImGui : : Text ( " Color widget with Float Display: " ) ;
ImGui : : ColorEdit4 ( " MyColor##2f " , ( float * ) & color , ImGuiColorEditFlags_Float | alpha_ flags) ;
ImGui : : ColorEdit4 ( " MyColor##2f " , ( float * ) & color , ImGuiColorEditFlags_Float | alpha_ previw_ flags) ;
ImGui : : Text ( " Color button with Picker: " ) ;
ImGui : : SameLine ( ) ; ShowHelpMarker ( " With the ImGuiColorEditFlags_NoInputs flag you can hide all the slider/text inputs. \n With the ImGuiColorEditFlags_NoLabel flag you can pass a non-empty label which will only be used for the tooltip and picker popup. " ) ;
ImGui : : ColorEdit4 ( " MyColor##3 " , ( float * ) & color , ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel | alpha_ flags) ;
ImGui : : ColorEdit4 ( " MyColor##3 " , ( float * ) & color , ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel | alpha_ previw_ flags) ;
ImGui : : Text ( " Color button only: " ) ;
ImGui : : ColorButton ( " MyColor##3b " , * ( ImVec4 * ) & color , alpha_ flags, ImVec2 ( 80 , 80 ) ) ;
ImGui : : ColorButton ( " MyColor##3b " , * ( ImVec4 * ) & color , alpha_ previw_ flags, ImVec2 ( 80 , 80 ) ) ;
ImGui : : Text ( " Color picker: " ) ;
static bool alpha = false ;
static bool alpha_bar = false ;
static int inputs_mode = 0 ;
static int inputs_mode = 2 ;
static float width = 200.0f ;
ImGui : : Checkbox ( " With Alpha " , & alpha ) ;
ImGui : : Checkbox ( " With Alpha Bar " , & alpha_bar ) ;
ImGui : : Combo ( " Mode " , & inputs_mode , " All Inputs \0 No Inputs \0 RGB Input \0 HSV Input \0 HEX Input \0 " ) ;
ImGui : : DragFloat ( " Width " , & width , 1.0f , 1.0f , 999.0f ) ;
ImGui : : PushItemWidth ( width ) ;
ImGuiColorEditFlags flags = 0 ;
ImGuiColorEditFlags flags = alpha_previw_flags ;
if ( ! alpha ) flags | = ImGuiColorEditFlags_NoAlpha ; // This is by default if you call ColorPicker3() instead of ColorPicker4()
if ( alpha_bar ) flags | = ImGuiColorEditFlags_AlphaBar ;
if ( inputs_mode = = 1 ) flags | = ImGuiColorEditFlags_NoInputs ;