![]() |
VOOZH | about |
dotnet add package ktsu.ImGuiStyler --version 1.3.12
NuGet\Install-Package ktsu.ImGuiStyler -Version 1.3.12
<PackageReference Include="ktsu.ImGuiStyler" Version="1.3.12" />
<PackageVersion Include="ktsu.ImGuiStyler" Version="1.3.12" />Directory.Packages.props
<PackageReference Include="ktsu.ImGuiStyler" />Project file
paket add ktsu.ImGuiStyler --version 1.3.12
#r "nuget: ktsu.ImGuiStyler, 1.3.12"
#:package ktsu.ImGuiStyler@1.3.12
#addin nuget:?package=ktsu.ImGuiStyler&version=1.3.12Install as a Cake Addin
#tool nuget:?package=ktsu.ImGuiStyler&version=1.3.12Install as a Cake Tool
A powerful, expressive styling library for ImGui.NET interfaces that simplifies theme management, provides scoped styling utilities, and offers advanced color manipulation with accessibility features.
ktsu.ThemeProvider for consistent, semantic color themingAdd ImGuiStyler to your project via NuGet:
<PackageReference Include="ktsu.ImGuiStyler" Version="1.3.10" />
Or via Package Manager Console:
Install-Package ktsu.ImGuiStyler
using ktsu.ImGuiStyler;
using Hexa.NET.ImGui;
// Apply a global theme
Theme.Apply("TokyoNight");
// Use scoped styling for specific elements
using (new ScopedColor(ImGuiCol.Text, Color.FromHex("#ff6b6b")))
{
ImGui.Text("This text is red!");
}
// Center content automatically
using (new Alignment.Center(ImGui.CalcTextSize("Centered!")))
{
ImGui.Text("Centered!");
}
// Apply any of the 50+ built-in themes
Theme.Apply("Catppuccin.Mocha");
Theme.Apply("Gruvbox.Dark");
Theme.Apply("Tokyo Night");
// Get current theme information
string? currentTheme = Theme.CurrentThemeName;
bool isCurrentThemeDark = Theme.IsCurrentThemeDark;
// Reset to default ImGui theme
Theme.Reset();
// Show the theme browser modal
if (ImGui.Button("Choose Theme"))
{
Theme.ShowThemeSelector("Select a Theme");
}
// Render the theme selector (call this in your main render loop)
if (Theme.RenderThemeSelector())
{
Console.WriteLine($"Theme changed to: {Theme.CurrentThemeName}");
}
using (new ScopedTheme("Dracula"))
{
ImGui.Text("This text uses Dracula theme");
ImGui.Button("Themed button");
using (new ScopedTheme("Nord"))
{
ImGui.Text("Nested Nord theme");
}
// Automatically reverts to Dracula
}
// Automatically reverts to previous theme
// From hex strings
ImColor red = Color.FromHex("#ff0000");
ImColor blueWithAlpha = Color.FromHex("#0066ffcc");
// From RGB values
ImColor green = Color.FromRGB(0, 255, 0);
ImColor customColor = Color.FromRGBA(255, 128, 64, 200);
// From HSV
ImColor rainbow = Color.FromHSV(0.83f, 1.0f, 1.0f); // Purple
ImColor baseColor = Color.FromHex("#3498db");
// Adjust brightness
ImColor lighter = Color.Lighten(baseColor, 0.3f);
ImColor darker = Color.Darken(baseColor, 0.2f);
// Accessibility-focused text colors
ImColor optimalText = Color.GetOptimalTextColor(baseColor);
ImColor contrastText = Color.GetContrastingTextColor(baseColor);
// Scoped text color
using (new ScopedTextColor(Color.FromHex("#e74c3c")))
{
ImGui.Text("Red text");
}
// Scoped UI element color
using (new ScopedColor(ImGuiCol.Button, Color.FromHex("#2ecc71")))
{
ImGui.Button("Green button");
}
// Multiple scoped colors
using (new ScopedColor(ImGuiCol.Button, Color.FromHex("#9b59b6")))
using (new ScopedColor(ImGuiCol.ButtonHovered, Color.FromHex("#8e44ad")))
using (new ScopedColor(ImGuiCol.ButtonActive, Color.FromHex("#71368a")))
{
ImGui.Button("Fully styled button");
}
// Center text
string text = "Perfectly centered!";
using (new Alignment.Center(ImGui.CalcTextSize(text)))
{
ImGui.Text(text);
}
// Center buttons
using (new Alignment.Center(new Vector2(120, 30)))
{
ImGui.Button("Centered Button", new Vector2(120, 30));
}
Vector2 containerSize = new(400, 200);
Vector2 contentSize = new(100, 50);
// Center content within a specific container
using (new Alignment.CenterWithin(contentSize, containerSize))
{
ImGui.Button("Centered in Container", contentSize);
}
// Rounded buttons
using (new ScopedStyleVar(ImGuiStyleVar.FrameRounding, 8.0f))
{
ImGui.Button("Rounded Button");
}
// Multiple style modifications
using (new ScopedStyleVar(ImGuiStyleVar.FrameRounding, 12.0f))
using (new ScopedStyleVar(ImGuiStyleVar.FramePadding, new Vector2(20, 10)))
using (new ScopedStyleVar(ImGuiStyleVar.ItemSpacing, new Vector2(10, 8)))
{
ImGui.Button("Highly Styled Button");
ImGui.Button("Another Styled Button");
}
// Use semantic colors from current theme
using (new ScopedThemeColor(Color.Primary))
{
ImGui.Text("Primary theme color");
}
using (new ScopedThemeColor(Color.Secondary))
{
ImGui.Button("Secondary theme button");
}
ImGuiStyler includes 50+ carefully crafted themes across multiple families:
Theme.Apply(string themeName) - Apply a global themeTheme.Apply(ISemanticTheme theme) - Apply a semantic themeTheme.Reset() - Reset to default ImGui themeTheme.ShowThemeSelector(string title) - Show theme browser modalTheme.RenderThemeSelector() - Render theme browser (returns true if theme changed)Theme.AllThemes - Get all available themesTheme.Families - Get all theme familiesTheme.CurrentThemeName - Get current theme nameTheme.IsCurrentThemeDark - Check if current theme is darkColor.FromHex(string hex) - Create color from hex stringColor.FromRGB(int r, int g, int b) - Create color from RGBColor.FromRGBA(int r, int g, int b, int a) - Create color from RGBAColor.GetOptimalTextColor(ImColor background) - Get accessible text colorColor.Lighten(ImColor color, float amount) - Lighten colorColor.Darken(ImColor color, float amount) - Darken colornew Alignment.Center(Vector2 contentSize) - Center in available regionnew Alignment.CenterWithin(Vector2 contentSize, Vector2 containerSize) - Center in containernew ScopedColor(ImGuiCol col, ImColor color) - Scoped color applicationnew ScopedTextColor(ImColor color) - Scoped text colornew ScopedStyleVar(ImGuiStyleVar var, float value) - Scoped style variablenew ScopedTheme(string themeName) - Scoped theme applicationnew ScopedThemeColor(Color semanticColor) - Scoped semantic colorThe included demo application showcases all features:
cd ImGuiStylerDemo
dotnet run
Features demonstrated:
We welcome contributions! Please see our contributing guidelines:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)git clone https://github.com/ktsu-dev/ImGuiStyler.git
cd ImGuiStyler
dotnet restore
dotnet build
This project is licensed under the MIT License - see the file for details.
Made with ❤️ by the ktsu.dev team
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on ktsu.ImGuiStyler:
| Package | Downloads |
|---|---|
|
ktsu.ImGuiWidgets
A library of custom widgets using ImGui.NET and utilities to enhance ImGui-based applications. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.3.12 | 1,317 | 7/23/2025 |
| 1.3.11 | 606 | 7/23/2025 |
| 1.3.10 | 614 | 7/23/2025 |
| 1.3.9 | 621 | 7/22/2025 |
| 1.3.8 | 611 | 7/22/2025 |
| 1.3.7 | 624 | 7/22/2025 |
| 1.3.6 | 615 | 7/22/2025 |
| 1.3.5 | 614 | 7/22/2025 |
| 1.3.4 | 595 | 7/22/2025 |
| 1.3.3 | 266 | 7/18/2025 |
| 1.3.3-pre.20 | 165 | 7/9/2025 |
| 1.3.3-pre.19 | 329 | 6/11/2025 |
| 1.3.3-pre.18 | 186 | 5/20/2025 |
| 1.3.3-pre.15 | 136 | 5/17/2025 |
| 1.3.3-pre.14 | 186 | 5/16/2025 |
| 1.3.3-pre.13 | 267 | 5/15/2025 |
| 1.3.3-pre.12 | 255 | 5/14/2025 |
| 1.3.3-pre.11 | 253 | 5/13/2025 |
| 1.3.3-pre.10 | 290 | 5/12/2025 |
| 1.3.3-pre.9 | 228 | 5/11/2025 |
## v1.3.12 (patch)
Changes since v1.3.11:
- Enhance README and implement ScopedTheme functionality ([@matt-edmondson](https://github.com/matt-edmondson))