From 3407842a2b810af0088222d778842c603d779111 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Aug 2024 09:44:22 +0000 Subject: [PATCH 1/4] Bump Microsoft.NET.Test.Sdk from 17.10.0 to 17.11.0 Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.10.0 to 17.11.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.10.0...v17.11.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 45b4afb..1132695 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -87,7 +87,7 @@ - + From fcd3f99f896a80231ad0184abbcf26c8e1579850 Mon Sep 17 00:00:00 2001 From: Matt Edmondson Date: Fri, 23 Aug 2024 13:52:27 +1000 Subject: [PATCH 2/4] Add an accent color and use it for progress bars, plots, and histograms --- ImGuiStyler/Color.cs | 7 +++++++ ImGuiStyler/Theme.cs | 17 +++++++++++++---- ImGuiStylerDemo/ImGuiStylerDemo.cs | 1 + VERSION | 2 +- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/ImGuiStyler/Color.cs b/ImGuiStyler/Color.cs index 34693b3..115fe9a 100644 --- a/ImGuiStyler/Color.cs +++ b/ImGuiStyler/Color.cs @@ -240,6 +240,13 @@ public static ImColor MultiplySaturation(this ImColor color, float amount) return FromHSLA(hsla); } + public static ImColor OffsetHue(this ImColor color, float amount) + { + var hsla = color.ToHSLA(); + hsla.X = (1f + (hsla.X + amount)) % 1f; + return FromHSLA(hsla); + } + public static ImColor LightenBy(this ImColor color, float amount) { var hsla = color.ToHSLA(); diff --git a/ImGuiStyler/Theme.cs b/ImGuiStyler/Theme.cs index 2d7145f..d7333e4 100644 --- a/ImGuiStyler/Theme.cs +++ b/ImGuiStyler/Theme.cs @@ -8,6 +8,11 @@ public static class Theme { private static float NormalLuminanceMult { get; set; } = 0.4f; private static float NormalSaturationMult { get; set; } = 0.5f; + private static float AccentLuminanceMult { get; set; } = 0.7f; + private static float AccentSaturationMult { get; set; } = 0.8f; + private static float AccentHoveredLuminanceMult { get; set; } = 1.0f; + private static float AccentHoveredSaturationMult { get; set; } = 0.9f; + private static float AccentHueOffset { get; set; } = 0.5f; private static float HeaderLuminanceMult { get; set; } = 0.5f; private static float HeaderSaturationMult { get; set; } = 0.6f; private static float ActiveLuminanceMult { get; set; } = .6f; @@ -22,6 +27,8 @@ public static class Theme public static ImColor GetStateColor(ImColor baseColor, bool enabled) => enabled ? baseColor : baseColor.MultiplySaturation(DisabledSaturationMult); public static ImColor GetNormalColor(ImColor stateColor) => stateColor.MultiplyLuminance(NormalLuminanceMult).MultiplySaturation(NormalSaturationMult); + public static ImColor GetAccentColor(ImColor stateColor) => stateColor.MultiplyLuminance(AccentLuminanceMult).MultiplySaturation(AccentSaturationMult).OffsetHue(AccentHueOffset).WithAlpha(1); + public static ImColor GetAccentHoveredColor(ImColor stateColor) => stateColor.MultiplyLuminance(AccentHoveredLuminanceMult).MultiplySaturation(AccentHoveredSaturationMult).OffsetHue(AccentHueOffset).WithAlpha(1); public static ImColor GetHeaderColor(ImColor stateColor) => stateColor.MultiplyLuminance(HeaderLuminanceMult).MultiplySaturation(HeaderSaturationMult); public static ImColor GetActiveColor(ImColor stateColor) => stateColor.MultiplyLuminance(ActiveLuminanceMult).MultiplySaturation(ActiveSaturationMult); public static ImColor GetHoveredColor(ImColor stateColor) => stateColor.MultiplyLuminance(HoverLuminanceMult).MultiplySaturation(HoverSaturationMult); @@ -62,6 +69,8 @@ public static class Palette public static void Apply(ImColor baseColor) { var normalColor = GetNormalColor(baseColor); + var accentColor = GetAccentColor(baseColor); + var accentHoveredColor = GetAccentHoveredColor(baseColor); var headerColor = GetHeaderColor(baseColor); var hoveredColor = GetHoveredColor(baseColor); var activeColor = GetActiveColor(baseColor); @@ -101,10 +110,10 @@ public static void Apply(ImColor baseColor) colors[(int)ImGuiCol.ResizeGrip] = normalColor.Value; colors[(int)ImGuiCol.ResizeGripActive] = activeColor.Value; colors[(int)ImGuiCol.ResizeGripHovered] = hoveredColor.Value; - colors[(int)ImGuiCol.PlotLines] = normalColor.Value; - colors[(int)ImGuiCol.PlotLinesHovered] = hoveredColor.Value; - colors[(int)ImGuiCol.PlotHistogram] = normalColor.Value; - colors[(int)ImGuiCol.PlotHistogramHovered] = hoveredColor.Value; + colors[(int)ImGuiCol.PlotLines] = accentColor.Value; + colors[(int)ImGuiCol.PlotLinesHovered] = accentHoveredColor.Value; + colors[(int)ImGuiCol.PlotHistogram] = accentColor.Value; + colors[(int)ImGuiCol.PlotHistogramHovered] = accentHoveredColor.Value; colors[(int)ImGuiCol.ScrollbarGrab] = normalColor.WithSaturation(0).Value; colors[(int)ImGuiCol.ScrollbarGrabActive] = activeColor.WithSaturation(0).Value; colors[(int)ImGuiCol.ScrollbarGrabHovered] = hoveredColor.WithSaturation(0).Value; diff --git a/ImGuiStylerDemo/ImGuiStylerDemo.cs b/ImGuiStylerDemo/ImGuiStylerDemo.cs index b95c3d3..1d97be0 100644 --- a/ImGuiStylerDemo/ImGuiStylerDemo.cs +++ b/ImGuiStylerDemo/ImGuiStylerDemo.cs @@ -28,6 +28,7 @@ private void OnTick(float dt) ImGui.InputText("InputText", ref valueString, 128); float valueFloat = 0.0f; ImGui.SliderFloat("SliderFloat", ref valueFloat, 0.0f, 1.0f); + ImGui.ProgressBar(0.95f, new(300, 0)); ImGui.Text("Text"); ImGui.TextColored(new System.Numerics.Vector4(1.0f, 0.0f, 0.0f, 1.0f), "TextColored"); ImGui.TextDisabled("TextDisabled"); diff --git a/VERSION b/VERSION index 16a8712..88acddb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0-alpha.6 +1.0.0-alpha.7 From 68ad4f64c56e7b09f93e01a414bc57ecf8cd6108 Mon Sep 17 00:00:00 2001 From: Matt Edmondson Date: Fri, 23 Aug 2024 14:08:46 +1000 Subject: [PATCH 3/4] Fix for accent colors not being used with scoped themes --- ImGuiStyler/Theme.cs | 10 ++++++---- VERSION | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ImGuiStyler/Theme.cs b/ImGuiStyler/Theme.cs index d7333e4..b16d766 100644 --- a/ImGuiStyler/Theme.cs +++ b/ImGuiStyler/Theme.cs @@ -128,6 +128,8 @@ public ScopedThemeColor(ImColor baseColor, bool enabled) { var stateColor = GetStateColor(baseColor, enabled); var normalColor = GetNormalColor(stateColor); + var accentColor = GetAccentColor(baseColor); + var accentHoveredColor = GetAccentHoveredColor(baseColor); var headerColor = GetHeaderColor(stateColor); var hoveredColor = GetHoveredColor(stateColor); var activeColor = GetActiveColor(stateColor); @@ -167,10 +169,10 @@ public ScopedThemeColor(ImColor baseColor, bool enabled) PushStyleAndCount(ImGuiCol.ResizeGrip, normalColor, ref numStyles); PushStyleAndCount(ImGuiCol.ResizeGripActive, activeColor, ref numStyles); PushStyleAndCount(ImGuiCol.ResizeGripHovered, hoveredColor, ref numStyles); - PushStyleAndCount(ImGuiCol.PlotLines, normalColor, ref numStyles); - PushStyleAndCount(ImGuiCol.PlotLinesHovered, hoveredColor, ref numStyles); - PushStyleAndCount(ImGuiCol.PlotHistogram, normalColor, ref numStyles); - PushStyleAndCount(ImGuiCol.PlotHistogramHovered, hoveredColor, ref numStyles); + PushStyleAndCount(ImGuiCol.PlotLines, accentColor, ref numStyles); + PushStyleAndCount(ImGuiCol.PlotLinesHovered, accentHoveredColor, ref numStyles); + PushStyleAndCount(ImGuiCol.PlotHistogram, accentColor, ref numStyles); + PushStyleAndCount(ImGuiCol.PlotHistogramHovered, accentHoveredColor, ref numStyles); PushStyleAndCount(ImGuiCol.ScrollbarGrab, normalColor, ref numStyles); PushStyleAndCount(ImGuiCol.ScrollbarGrabActive, activeColor, ref numStyles); PushStyleAndCount(ImGuiCol.ScrollbarGrabHovered, hoveredColor, ref numStyles); diff --git a/VERSION b/VERSION index 88acddb..3dedb75 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0-alpha.7 +1.0.0-alpha.8 From a52ab5a0299a47549038e8c3aa9eadac8ce54021 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 09:47:51 +0000 Subject: [PATCH 4/4] Bump ktsu.io.ImGuiApp from 1.0.0-alpha.15 to 1.0.0-alpha.16 Bumps [ktsu.io.ImGuiApp](https://github.com/ktsu-io/ImGuiApp) from 1.0.0-alpha.15 to 1.0.0-alpha.16. - [Release notes](https://github.com/ktsu-io/ImGuiApp/releases) - [Commits](https://github.com/ktsu-io/ImGuiApp/compare/1.0.0-alpha.15...1.0.0-alpha.16) --- updated-dependencies: - dependency-name: ktsu.io.ImGuiApp dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- ImGuiStylerDemo/ImGuiStylerDemo.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ImGuiStylerDemo/ImGuiStylerDemo.csproj b/ImGuiStylerDemo/ImGuiStylerDemo.csproj index 4a109ba..62c06ea 100644 --- a/ImGuiStylerDemo/ImGuiStylerDemo.csproj +++ b/ImGuiStylerDemo/ImGuiStylerDemo.csproj @@ -4,7 +4,7 @@ - +