Add project files.
This commit is contained in:
211
ColorPicker++/ColorPicker++.vcxproj
Normal file
211
ColorPicker++/ColorPicker++.vcxproj
Normal file
@@ -0,0 +1,211 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Dist|Win32">
|
||||
<Configuration>Dist</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Dist|x64">
|
||||
<Configuration>Dist</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{d37e147b-02a4-42ad-8ac8-84f33f18cde8}</ProjectGuid>
|
||||
<RootNamespace>ColorPicker</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Dist|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Dist|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Dist|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Dist|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Dist|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WL_PLATFORM_WINDOWS;WL_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<LanguageStandard_C>stdclatest</LanguageStandard_C>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)DesktopApp\src;$(SolutionDir)ImGui\src;</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>d3d12.lib;d3dcompiler.lib;dxgi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Dist|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\ColorPicker.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\ColorPicker.hpp" />
|
||||
<ClInclude Include="src\ColorPicker_Vars.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DesktopApp\DesktopApp.vcxproj">
|
||||
<Project>{f38ce72b-5036-4782-8ae3-cd441404e1f4}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\ImGui\ImGui.vcxproj">
|
||||
<Project>{edc99a4f-84d6-48ab-ad18-f16581766915}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
30
ColorPicker++/ColorPicker++.vcxproj.filters
Normal file
30
ColorPicker++/ColorPicker++.vcxproj.filters
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\ColorPicker.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\ColorPicker.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\ColorPicker_Vars.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
12
ColorPicker++/src/ColorPicker.cpp
Normal file
12
ColorPicker++/src/ColorPicker.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#include "ColorPicker.hpp"
|
||||
|
||||
Desktop::Application* Desktop::CreateApplication(int argc, char** argv)
|
||||
{
|
||||
Desktop::ApplicationSpecification spec;
|
||||
spec.Name = L"Color Picker ++";
|
||||
//spec.Size = ImVec2(0, 0); Needs fixed; We currently hardcode the window size.
|
||||
|
||||
Desktop::Application* app = new Desktop::Application(spec);
|
||||
app->PushLayer<MainLayer>();
|
||||
return app;
|
||||
}
|
||||
494
ColorPicker++/src/ColorPicker.hpp
Normal file
494
ColorPicker++/src/ColorPicker.hpp
Normal file
@@ -0,0 +1,494 @@
|
||||
#pragma once
|
||||
#include "Application.hpp"
|
||||
#include "EntryPoint.hpp"
|
||||
#include "ColorPicker_Vars.hpp"
|
||||
|
||||
#define WND_SIZEX GetSystemMetrics(SM_CXSCREEN)
|
||||
#define WND_SIZEY GetSystemMetrics(SM_CYSCREEN)
|
||||
|
||||
namespace ImGui
|
||||
{
|
||||
static DWORD windowFlags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings;
|
||||
static ImVec4 windowBgColor = { 0.55f, 0.55f, 0.55f, 1.00f }; // 0.22f, 0.22f, 0.22f
|
||||
static ImVec4 childBgColor = { 0.55f, 0.55f, 0.55f, 1.00f };
|
||||
static ImVec4 textColor = { 1.00f, 1.00f, 1.00f, 1.00f };
|
||||
static ImVec4 sliderColor = { 1.00f, 1.00f, 1.00f, 1.00f };
|
||||
static ImVec4 sliderScrollColor = { 1.00f, 1.00f, 1.00f, 1.00f };
|
||||
static ImVec4 textDisabledColor = { 0.50f, 0.50f, 0.50f, 1.00f };
|
||||
static ImVec4 transparentColor = { 0.00f, 0.00f, 0.00f, 0.00f };
|
||||
static ImVec4 iconColor = ImVec4(ImColor(0, 68, 170, 200));
|
||||
static ImVec4 currentColorPicked = { 1.00f, 1.00f, 1.00f, 1.00f };
|
||||
static ImVec4 newColorPicked = { 1.00f, 1.00f, 1.00f, 1.00f };
|
||||
static ImVec4 newIconColorActive = { 1.00f, 1.00f, 1.00f, 1.00f };
|
||||
static ImVec4 newIconColorInactive = { 1.00f, 1.00f, 1.00f, 1.00f };
|
||||
static int iRValue = 0;
|
||||
static int iGValue = 0;
|
||||
static int iBValue = 0;
|
||||
ImVec4 active = ImVec4(ImColor(0, 100, 200, 255));
|
||||
ImVec4 inactive = ImVec4(ImColor(0, 68, 170, 255));
|
||||
|
||||
static void SetUITheme()
|
||||
{
|
||||
ImGuiStyle& Style = ImGui::GetStyle();
|
||||
Style.WindowPadding = ImVec2(0.00f, 0.00f);
|
||||
Style.CellPadding = ImVec2(6.00f, 6.00f);
|
||||
Style.ItemSpacing = ImVec2(0.00f, 0.00f);
|
||||
Style.ItemInnerSpacing = ImVec2(6.00f, 6.00f);
|
||||
Style.TouchExtraPadding = ImVec2(0.00f, 0.00f);
|
||||
Style.ScrollbarSize = 15;
|
||||
Style.GrabMinSize = 20;
|
||||
Style.WindowBorderSize = 0;
|
||||
Style.ChildBorderSize = 0;
|
||||
Style.PopupBorderSize = 2;
|
||||
Style.FrameBorderSize = 0;
|
||||
Style.TabBorderSize = 1;
|
||||
Style.ChildRounding = 4;
|
||||
Style.FrameRounding = 3;
|
||||
Style.PopupRounding = 4;
|
||||
Style.ScrollbarRounding = 9;
|
||||
Style.IndentSpacing = 0;
|
||||
Style.GrabRounding = 3;
|
||||
Style.LogSliderDeadzone = 4;
|
||||
Style.TabRounding = 4;
|
||||
Style.Colors[ImGuiCol_Text] = textColor;
|
||||
Style.Colors[ImGuiCol_TextDisabled] = textDisabledColor;
|
||||
Style.Colors[ImGuiCol_WindowBg] = windowBgColor;
|
||||
Style.Colors[ImGuiCol_ChildBg] = childBgColor;
|
||||
//Style.Colors[ImGuiCol_PopupBg] = ImVec4(0.19f, 0.19f, 0.19f, 0.92f);
|
||||
Style.Colors[ImGuiCol_Border] = ImVec4(0.26f, 0.26f, 0.26f, 1.00f);
|
||||
Style.Colors[ImGuiCol_BorderShadow] = ImVec4(0.26f, 0.26f, 0.26f, 1.00f);
|
||||
Style.Colors[ImGuiCol_FrameBg] = sliderScrollColor;
|
||||
Style.Colors[ImGuiCol_FrameBgHovered] = sliderScrollColor;
|
||||
Style.Colors[ImGuiCol_FrameBgActive] = sliderScrollColor;
|
||||
//Style.Colors[ImGuiCol_TitleBg] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
|
||||
//Style.Colors[ImGuiCol_TitleBgActive] = ImVec4(0.06f, 0.06f, 0.06f, 1.00f);
|
||||
//Style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
|
||||
//Style.Colors[ImGuiCol_MenuBarBg] = ImVec4(0.14f, 0.14f, 0.14f, 1.00f);
|
||||
Style.Colors[ImGuiCol_ScrollbarBg] = sliderScrollColor;
|
||||
Style.Colors[ImGuiCol_ScrollbarGrab] = sliderScrollColor;
|
||||
Style.Colors[ImGuiCol_ScrollbarGrabHovered] = sliderScrollColor;
|
||||
Style.Colors[ImGuiCol_ScrollbarGrabActive] = sliderScrollColor;
|
||||
//Style.Colors[ImGuiCol_CheckMark] = ImVec4(1.00f, 0.941f, 0.796f, 1.00f);
|
||||
Style.Colors[ImGuiCol_SliderGrab] = sliderColor;
|
||||
Style.Colors[ImGuiCol_SliderGrabActive] = sliderColor;
|
||||
//Style.Colors[ImGuiCol_Button] = ImVec4(0.592f, 0.137f, 0.00f, 0.54f);
|
||||
//Style.Colors[ImGuiCol_ButtonHovered] = ImVec4(0.592f, 0.137f, 0.00f, 0.34f);
|
||||
//Style.Colors[ImGuiCol_ButtonActive] = ImVec4(0.592f, 0.137f, 0.00f, 0.24f);
|
||||
//Style.Colors[ImGuiCol_Header] = ImVec4(0.00f, 0.00f, 0.00f, 0.52f);
|
||||
//Style.Colors[ImGuiCol_HeaderHovered] = ImVec4(0.00f, 0.00f, 0.00f, 0.36f);
|
||||
//Style.Colors[ImGuiCol_HeaderActive] = ImVec4(0.20f, 0.22f, 0.23f, 0.33f);
|
||||
//Style.Colors[ImGuiCol_Separator] = ImVec4(0.063f, 0.00f, 0.02f, 1.00f); // 0.28f, 0.28f, 0.28f, 0.29f
|
||||
//Style.Colors[ImGuiCol_SeparatorHovered] = ImVec4(0.44f, 0.44f, 0.44f, 0.29f);
|
||||
//Style.Colors[ImGuiCol_SeparatorActive] = ImVec4(0.40f, 0.44f, 0.47f, 1.00f);
|
||||
//Style.Colors[ImGuiCol_ResizeGrip] = ImVec4(0.28f, 0.28f, 0.28f, 0.29f);
|
||||
//Style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.44f, 0.44f, 0.44f, 0.29f);
|
||||
//Style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.40f, 0.44f, 0.47f, 1.00f);
|
||||
//Style.Colors[ImGuiCol_Tab] = ImVec4(0.00f, 0.00f, 0.00f, 0.52f);
|
||||
//Style.Colors[ImGuiCol_TabHovered] = ImVec4(0.14f, 0.14f, 0.14f, 1.00f);
|
||||
//Style.Colors[ImGuiCol_TabActive] = ImVec4(0.20f, 0.20f, 0.20f, 0.36f);
|
||||
//Style.Colors[ImGuiCol_TabUnfocused] = ImVec4(0.00f, 0.00f, 0.00f, 0.52f);
|
||||
//Style.Colors[ImGuiCol_TabUnfocusedActive] = ImVec4(0.14f, 0.14f, 0.14f, 1.00f);
|
||||
////Style.Colors[ImGuiCol_DockingPreview] = ImVec4(0.33f, 0.67f, 0.86f, 1.00f);
|
||||
////Style.Colors[ImGuiCol_DockingEmptyBg] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
|
||||
//Style.Colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
|
||||
//Style.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
|
||||
//Style.Colors[ImGuiCol_PlotHistogram] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
|
||||
////Style.Colors[ImGuiCol_PlotHistogram_GRAD] = colToVec(255, 200, 0, 255);
|
||||
//Style.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
|
||||
//Style.Colors[ImGuiCol_TableHeaderBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.52f);
|
||||
//Style.Colors[ImGuiCol_TableBorderStrong] = ImVec4(0.00f, 0.00f, 0.00f, 0.52f);
|
||||
//Style.Colors[ImGuiCol_TableBorderLight] = ImVec4(0.28f, 0.28f, 0.28f, 0.29f);
|
||||
//Style.Colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
|
||||
//Style.Colors[ImGuiCol_TableRowBgAlt] = ImVec4(1.00f, 1.00f, 1.00f, 0.06f);
|
||||
//Style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.20f, 0.22f, 0.23f, 1.00f);
|
||||
//Style.Colors[ImGuiCol_DragDropTarget] = ImVec4(0.33f, 0.67f, 0.86f, 1.00f);
|
||||
//Style.Colors[ImGuiCol_NavHighlight] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
|
||||
//Style.Colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 0.00f, 0.00f, 0.70f);
|
||||
//Style.Colors[ImGuiCol_NavWindowingDimBg] = ImVec4(1.00f, 0.00f, 0.00f, 0.20f);
|
||||
//Style.Colors[ImGuiCol_ModalWindowDimBg] = ImVec4(1.00f, 0.00f, 0.00f, 0.35f);
|
||||
}
|
||||
|
||||
static void SCP(float xPos, float yPos)
|
||||
{
|
||||
ImGui::SetCursorPos(ImVec2(xPos, yPos));
|
||||
}
|
||||
|
||||
static void SCPX(float xPos)
|
||||
{
|
||||
ImGui::SetCursorPosX(xPos);
|
||||
}
|
||||
|
||||
static void SCPY(float yPos)
|
||||
{
|
||||
ImGui::SetCursorPosY(yPos);
|
||||
}
|
||||
|
||||
static float GetX()
|
||||
{
|
||||
return ImGui::GetContentRegionAvail().x;
|
||||
}
|
||||
|
||||
static float GetY()
|
||||
{
|
||||
return ImGui::GetContentRegionAvail().y;
|
||||
}
|
||||
|
||||
static void HoroizontalLine(int newId, ImVec2 size, ImVec2 pos)
|
||||
{
|
||||
std::string id = ("ImGui_Sauce_line_" + std::to_string(newId));
|
||||
ImGui::SCP(pos.x, pos.y);
|
||||
{
|
||||
ImGui::PushStyleColor(ImGuiCol_ChildBg, childBgColor);
|
||||
ImGui::BeginChild(id.c_str(), ImVec2(size.x, size.y), true);
|
||||
ImGui::EndChild();
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
}
|
||||
|
||||
static void CenterText(const char* text, BOOL newLine)
|
||||
{
|
||||
ImGui::Spacing();
|
||||
ImGui::SameLine((ImGui::GetContentRegionAvail().x / 2) - (ImGui::CalcTextSize(text).x / 2));
|
||||
ImGui::Text(text);
|
||||
ImGui::Spacing();
|
||||
if (newLine)
|
||||
ImGui::NewLine();
|
||||
}
|
||||
|
||||
static void ButtonIcon(const char* buttonName, int* page, int pageNumber, ImVec2 buttonPos, ImVec2 size)
|
||||
{
|
||||
ImDrawList* drawList = ImGui::GetWindowDrawList();
|
||||
ImU32 colBg;
|
||||
ImGui::SCP(buttonPos.x, buttonPos.y);
|
||||
ImGui::InvisibleButton(buttonName, size);
|
||||
if (ImGui::IsItemClicked())
|
||||
*page = pageNumber;
|
||||
|
||||
if (ImGui::IsItemHovered())
|
||||
colBg = ImGui::GetColorU32(ImGui::newIconColorActive);
|
||||
else
|
||||
colBg = ImGui::GetColorU32(ImGui::newIconColorInactive);
|
||||
|
||||
ImGui::PushFont(ImGui::FA3);
|
||||
ImGui::SCP(buttonPos.x, buttonPos.y + 5.f);
|
||||
ImVec2 textPos = ImGui::GetCursorScreenPos();
|
||||
const char* text = buttonName;
|
||||
drawList->AddText(textPos, colBg, text, text + strlen(text));
|
||||
ImGui::PopFont();
|
||||
}
|
||||
|
||||
static void ButtonIcon2(const char* buttonName, bool* featureBool, ImVec2 buttonPos, ImVec2 size)
|
||||
{
|
||||
ImDrawList* drawList = ImGui::GetWindowDrawList();
|
||||
ImU32 colBg;
|
||||
ImGui::SCP(buttonPos.x, buttonPos.y);
|
||||
ImGui::InvisibleButton(buttonName, size);
|
||||
if (ImGui::IsItemClicked())
|
||||
*featureBool = !*featureBool;
|
||||
|
||||
if (ImGui::IsItemHovered())
|
||||
{
|
||||
ColorPicker::bEyeDropperHovered = true;
|
||||
colBg = ImGui::GetColorU32(ImGui::newIconColorActive);
|
||||
}
|
||||
else
|
||||
{
|
||||
ColorPicker::bEyeDropperHovered = false;
|
||||
colBg = ImGui::GetColorU32(ImGui::newIconColorInactive);
|
||||
}
|
||||
|
||||
|
||||
ImGui::PushFont(ImGui::FA3);
|
||||
ImGui::SCP(buttonPos.x, buttonPos.y + 5.f);
|
||||
ImVec2 textPos = ImGui::GetCursorScreenPos();
|
||||
const char* text = buttonName;
|
||||
drawList->AddText(textPos, colBg, text, text + strlen(text));
|
||||
ImGui::PopFont();
|
||||
}
|
||||
|
||||
static void ButtonIndicator(ImVec2 buttonPos)
|
||||
{
|
||||
if (ColorPicker::iTab == 0)
|
||||
{
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, active);
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, active);
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, active);
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, active);
|
||||
ImGui::SameLine();
|
||||
ImGui::SCP(buttonPos.x - 25.5f, buttonPos.y + 12);
|
||||
ImGui::Button("##Window1", ImVec2(5, 25));
|
||||
ImGui::PopStyleColor(4);
|
||||
}
|
||||
if (ColorPicker::iTab == 1)
|
||||
{
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, active);
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, active);
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, active);
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, active);
|
||||
ImGui::SameLine();
|
||||
ImGui::SCP(buttonPos.x - 25.5f, buttonPos.y + 12);
|
||||
ImGui::Button("##Window2", ImVec2(5, 25));
|
||||
ImGui::PopStyleColor(4);
|
||||
}
|
||||
if (ColorPicker::iTab == 2)
|
||||
{
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, active);
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, active);
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, active);
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, active);
|
||||
ImGui::SameLine();
|
||||
ImGui::SCP(buttonPos.x - 25.5f, buttonPos.y + 12);
|
||||
ImGui::Button("##Window3", ImVec2(5, 25));
|
||||
ImGui::PopStyleColor(4);
|
||||
}
|
||||
if (ColorPicker::iTab == 3)
|
||||
{
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, active);
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, active);
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, active);
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, active);
|
||||
ImGui::SameLine();
|
||||
ImGui::SCP(buttonPos.x - 25.5f, buttonPos.y + 12);
|
||||
ImGui::Button("##Window4", ImVec2(5, 25));
|
||||
ImGui::PopStyleColor(4);
|
||||
}
|
||||
}
|
||||
|
||||
static void CustomContentWindow(const char* windowName, float windowSizeY, ImVec2 windowPos)
|
||||
{
|
||||
ImGui::SCP(windowPos.x, windowPos.y);
|
||||
ImGui::PushStyleColor(ImGuiCol_ChildBg, windowBgColor);
|
||||
ImGui::BeginChild(windowName, ImVec2(ImGui::GetX() - 10.f, windowSizeY));
|
||||
ImGui::EndChild();
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
|
||||
static void TaskbarCustomWindow(const char* windowName, const char* contentText, float windowSizeY, ImVec2 windowPos)
|
||||
{
|
||||
ImGui::SCP(windowPos.x, windowPos.y);
|
||||
ImGui::PushStyleColor(ImGuiCol_ChildBg, windowBgColor);
|
||||
ImGui::BeginChild(windowName, ImVec2(ImGui::GetX() - 10.f, windowSizeY));
|
||||
ImGui::SCPY(10.f);
|
||||
ImGui::CenterText(contentText, FALSE);
|
||||
ImGui::EndChild();
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
|
||||
static void TaskbarCustomWindow2(const char* windowName, const char* contentText, float windowSizeY, ImVec2 windowPos)
|
||||
{
|
||||
ImGui::SCP(windowPos.x, windowPos.y);
|
||||
ImGui::PushStyleColor(ImGuiCol_ChildBg, childBgColor);
|
||||
ImGui::BeginChild(windowName, ImVec2(ImGui::GetX() - 10.f, windowSizeY));
|
||||
ImGui::SCPY(10.f);
|
||||
ImGui::CenterText(contentText, FALSE);
|
||||
ImGui::EndChild();
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
|
||||
static void ToggleButton(const char* toggleName, bool* featureBool, ImVec2 pos, BOOL newLine)
|
||||
{
|
||||
ImGui::SCP(pos.x, pos.y);
|
||||
ImVec2 p = ImGui::GetCursorScreenPos();
|
||||
ImDrawList* draw_list = ImGui::GetWindowDrawList();
|
||||
int id = pos.y;
|
||||
|
||||
float height = ImGui::GetFrameHeight();
|
||||
float width = height * 1.55f;
|
||||
float radius = height * 0.50f;
|
||||
|
||||
ImGui::InvisibleButton(toggleName, ImVec2(width, height));
|
||||
if (ImGui::IsItemClicked())
|
||||
*featureBool = !*featureBool;
|
||||
|
||||
float t = *featureBool ? 1.0f : 0.0f;
|
||||
|
||||
ImGuiContext& g = *GImGui;
|
||||
float ANIM_SPEED = 0.08f;
|
||||
if (g.LastActiveId == g.CurrentWindow->GetID(toggleName))// && g.LastActiveIdTimer < ANIM_SPEED)
|
||||
{
|
||||
float t_anim = ImSaturate(g.LastActiveIdTimer / ANIM_SPEED);
|
||||
t = *featureBool ? (t_anim) : (1.0f - t_anim);
|
||||
}
|
||||
|
||||
ImU32 col_bg;
|
||||
if (ImGui::IsItemHovered())
|
||||
col_bg = ImGui::GetColorU32(ImLerp(ImVec4(0.78f, 0.78f, 0.78f, 0.40f), ImVec4(ImColor(0, 68, 170, 200)), t));
|
||||
else
|
||||
col_bg = ImGui::GetColorU32(ImLerp(ImVec4(0.85f, 0.85f, 0.85f, 0.60f), ImVec4(ImColor(0, 68, 170, 255)), t));
|
||||
|
||||
draw_list->AddRectFilled(p, ImVec2(p.x + width, p.y + height), col_bg, height * 0.5f);
|
||||
draw_list->AddCircleFilled(ImVec2(p.x + radius + t * (width - radius * 2.0f), p.y + radius), radius - 1.5f, IM_COL32(225, 225, 225, 255));
|
||||
|
||||
ImGui::SCP(10.f, pos.y);
|
||||
ImGui::Text(toggleName);
|
||||
ImGui::NewLine();
|
||||
ImGui::HoroizontalLine(id, ImVec2(ImGui::GetX() - 20.f, 5.f), ImVec2(10.f, pos.y + 35.f));
|
||||
|
||||
if (newLine)
|
||||
ImGui::NewLine();
|
||||
}
|
||||
|
||||
static void CustomSliderInt(const char* sliderText, int* value, int min, int max, ImVec4 color)
|
||||
{
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBg, color);
|
||||
ImGui::SliderInt(sliderText, value, min, max);
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::NewLine();
|
||||
}
|
||||
|
||||
static COLORREF GetPixelColor(POINT& pos)
|
||||
{
|
||||
// Get the device context for the entire screen
|
||||
// Passing NULL to GetDC gets the DC for the primary monitor.
|
||||
HDC hdcScreen = GetDC(NULL);
|
||||
|
||||
if (hdcScreen == NULL)
|
||||
{
|
||||
// Failed to get screen DC
|
||||
return CLR_INVALID; // CLR_INVALID is a predefined value indicating an invalid color
|
||||
}
|
||||
|
||||
// Get the pixel color at the specified coordinates
|
||||
COLORREF pixelColor = GetPixel(hdcScreen, pos.x, pos.y);
|
||||
|
||||
// Release the screen device context
|
||||
ReleaseDC(NULL, hdcScreen);
|
||||
|
||||
// Check if GetPixel failed (can happen if coordinates are outside the screen)
|
||||
if (pixelColor == CLR_INVALID)
|
||||
{
|
||||
// GetPixel failed
|
||||
return CLR_INVALID;
|
||||
}
|
||||
|
||||
return pixelColor;
|
||||
}
|
||||
|
||||
static bool GetMousePos(POINT& pos)
|
||||
{
|
||||
if (GetCursorPos(&pos))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
static void GetCurrentPixelColor()
|
||||
{
|
||||
if (GetAsyncKeyState(VK_LBUTTON) & 1 && ColorPicker::bEyeDropper && !ColorPicker::bEyeDropperHovered)
|
||||
ColorPicker::bEyeDropper = false;
|
||||
|
||||
if (ColorPicker::bEyeDropper)
|
||||
{
|
||||
POINT currentMousePos;
|
||||
if (GetMousePos(currentMousePos))
|
||||
{
|
||||
COLORREF color = GetPixelColor(currentMousePos);
|
||||
|
||||
if (color != CLR_INVALID)
|
||||
{
|
||||
BYTE red = GetRValue(color);
|
||||
BYTE green = GetGValue(color);
|
||||
BYTE blue = GetBValue(color);
|
||||
|
||||
ImGui::iRValue = (int)red;
|
||||
ImGui::iGValue = (int)green;
|
||||
ImGui::iBValue = (int)blue;
|
||||
|
||||
ImGui::newColorPicked = { (float)red / 255.0f, (float)green / 255.0f, (float)blue / 255.0f, 1.0f };
|
||||
ImGui::windowBgColor = { (float)ImGui::iRValue / 255.0f, (float)ImGui::iGValue / 255.0f, (float)ImGui::iBValue / 255.0f, 1.0f };
|
||||
ImGui::childBgColor = { (float)ImGui::iRValue / 255.0f, (float)ImGui::iGValue / 255.0f, (float)ImGui::iBValue / 255.0f, 1.0f };
|
||||
ImGui::textColor = { (float)ImGui::iRValue / 255.0f + 0.50f, (float)ImGui::iGValue / 255.0f + 0.50f, (float)ImGui::iBValue / 255.0f + 0.50f, 1.0f };
|
||||
ImGui::newIconColorActive = { (float)ImGui::iRValue / 255.0f + 0.50f, (float)ImGui::iGValue / 255.0f + 0.50f, (float)ImGui::iBValue / 255.0f + 0.50f, 1.0f };
|
||||
ImGui::newIconColorInactive = { (float)ImGui::iRValue / 255.0f - 0.10f, (float)ImGui::iGValue / 255.0f - 0.10f, (float)ImGui::iBValue / 255.0f - 0.10f, 1.0f };
|
||||
ImGui::sliderColor = { (float)ImGui::iRValue / 255.0f + 0.20f, (float)ImGui::iGValue / 255.0f + 0.20f, (float)ImGui::iBValue / 255.0f + 0.20f, 1.0f };
|
||||
ImGui::sliderScrollColor = { (float)ImGui::iRValue / 255.0f - 0.20f, (float)ImGui::iGValue / 255.0f - 0.20f, (float)ImGui::iBValue / 255.0f - 0.20f, 1.0f };
|
||||
|
||||
if (ImGui::newColorPicked.x > 0.90f)
|
||||
{
|
||||
ImGui::textColor = { 0.20f, 0.20f, 0.20f, 1.0f };
|
||||
ImGui::newIconColorActive = { 0.20f, 0.20f, 0.20f, 1.0f };
|
||||
ImGui::newIconColorInactive = { 0.20f, 0.20f, 0.20f, 1.0f };
|
||||
ImGui::sliderColor = { 0.20f, 0.20f, 0.20f, 1.0f };
|
||||
}
|
||||
else if (ImGui::newColorPicked.x < 0.20f)
|
||||
{
|
||||
ImGui::textColor = { 0.90f, 0.90f, 0.90f, 1.0f };
|
||||
ImGui::newIconColorActive = { 0.90f, 0.90f, 0.90f, 1.0f };
|
||||
ImGui::newIconColorInactive = { 0.90f, 0.90f, 0.90f, 1.0f };
|
||||
ImGui::sliderColor = { 0.90f, 0.90f, 0.90f, 1.0f };
|
||||
}
|
||||
|
||||
std::cout << "Color at (" << currentMousePos.x << ", " << currentMousePos.y << "):"
|
||||
<< " R=" << ImGui::iRValue
|
||||
<< ", G=" << ImGui::iGValue
|
||||
<< ", B=" << ImGui::iBValue << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "Failed to get pixel color." << std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Failed to get mouse position.\n\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MainLayer : public Desktop::Layer
|
||||
{
|
||||
public:
|
||||
virtual void OnAttach() override
|
||||
{
|
||||
ImGui::SetUITheme();
|
||||
ImGui::SetNextWindowSize(Desktop::Application::GetWindowSize(), ImGuiCond_Always);
|
||||
}
|
||||
|
||||
virtual void OnUIRender() override
|
||||
{
|
||||
// Main UI Window.
|
||||
//ImGui::PushStyleColor(ImGuiCol_WindowBg, ImGui::)
|
||||
if (ImGui::Begin("Color Picker ++", nullptr, ImGui::windowFlags))
|
||||
{
|
||||
// Top Side Status Bar Window.
|
||||
ImGui::SCP(10.f, 10.f);
|
||||
//ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(0.55f, 0.55f, 0.55f, 1.f));
|
||||
if (ImGui::BeginChild("TopSideStatusBarWindow", ImVec2(ImGui::GetX() - 10.f, 50.f), true, ImGui::windowFlags))
|
||||
{
|
||||
ImGui::SCPY(15.f);
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::textColor);
|
||||
ImGui::PushFont(ImGui::Body);
|
||||
ImGui::CenterText("Color Picker ++", FALSE);
|
||||
ImGui::PopFont();
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::ButtonIcon(ICON_FA_COGS, &ColorPicker::iTab, 100, ImVec2(10.f, 7.f), ImVec2(35.f, 35.f)); // Config Page.
|
||||
ImGui::ButtonIcon2(ICON_FA_EYE_DROPPER, &ColorPicker::bEyeDropper, ImVec2(60.f, 7.f), ImVec2(35.f, 35.f));
|
||||
} ImGui::EndChild();
|
||||
|
||||
// Main Child Window.
|
||||
ImGui::SCP(10.f, 70.f);
|
||||
if (ImGui::BeginChild("MainChildWindow", ImVec2(ImGui::GetX() - 10.f, ImGui::GetY() - 10.f), true, ImGui::windowFlags))
|
||||
{
|
||||
if (ColorPicker::iTab == 0)
|
||||
{
|
||||
ImGui::SCP(10.f, 10.f);
|
||||
if (ImGui::BeginChild("MainSubChildWindow", ImVec2(ImGui::GetX() - 10.f, ImGui::GetY() - 10.f), true, ImGui::windowFlags))
|
||||
{
|
||||
//ImGui::SliderInt("R", &ImGui::iRValue, 0, 255);
|
||||
//ImGui::SliderInt("G", &ImGui::iGValue, 0, 255);
|
||||
//ImGui::SliderInt("B", &ImGui::iBValue, 0, 255);
|
||||
ImGui::CustomSliderInt("R", &ImGui::iRValue, 0, 255, ImVec4(1.f, 0.f, 0.f, 0.40f));
|
||||
ImGui::CustomSliderInt("G", &ImGui::iGValue, 0, 255, ImVec4(0.f, 1.f, 0.f, 0.40f));
|
||||
ImGui::CustomSliderInt("B", &ImGui::iBValue, 0, 255, ImVec4(0.f, 0.f, 1.f, 0.40f));
|
||||
} ImGui::EndChild();
|
||||
}
|
||||
} ImGui::EndChild();
|
||||
} ImGui::End();
|
||||
}
|
||||
|
||||
virtual void OnUpdate() override
|
||||
{
|
||||
ImGui::GetCurrentPixelColor();
|
||||
}
|
||||
};
|
||||
14
ColorPicker++/src/ColorPicker_Vars.hpp
Normal file
14
ColorPicker++/src/ColorPicker_Vars.hpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
namespace ColorPicker
|
||||
{
|
||||
static bool bEyeDropper = false;
|
||||
static bool bEyeDropperHovered = false;
|
||||
static int iTrackEyeDropper = 0;
|
||||
static bool bChangeUI = false;
|
||||
static bool bSettingsPage = false;
|
||||
static bool bTest = false;
|
||||
static int iTab = 0;
|
||||
static bool bSetupUI = false;
|
||||
static const char* appVersion = "v0.0.0.1";
|
||||
}
|
||||
Reference in New Issue
Block a user