ktsu.ImGuiStyler
1.3.12
Prefix Reserved
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" />
<PackageReference Include="ktsu.ImGuiStyler" />
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.12
#tool nuget:?package=ktsu.ImGuiStyler&version=1.3.12
ImGuiStyler 🎨
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.
✨ Features
🎨 Advanced Theme System
- 50+ Built-in Themes: Comprehensive collection including Catppuccin, Dracula, Gruvbox, Tokyo Night, Nord, and many more
- Interactive Theme Browser: Visual theme selection with live preview and categorization
- Semantic Theme Support: Leverages
ktsu.ThemeProvider
for consistent, semantic color theming - Scoped Theme Application: Apply themes to specific UI sections without affecting the global style
🎯 Precise Alignment Tools
- Automatic Content Centering: Center any content within containers or available regions
- Flexible Container Alignment: Align content within custom-sized containers
- Layout Integration: Seamlessly works with ImGui's existing layout system
🌈 Advanced Color Management
- Hex Color Support: Direct conversion from hex strings to ImGui colors
- Accessibility-First: Automatic contrast calculation and optimal text color selection
- Color Manipulation: Lighten, darken, and adjust colors programmatically
- Scoped Color Application: Apply colors to specific UI elements without side effects
🔧 Scoped Styling System
- Style Variables: Apply temporary style modifications with automatic cleanup
- Text Colors: Scoped text color changes with proper restoration
- Theme Colors: Apply theme-based colors to specific UI sections
- Memory Safe: Automatic resource management and style restoration
📦 Installation
Add ImGuiStyler to your project via NuGet:
<PackageReference Include="ktsu.ImGuiStyler" Version="1.3.10" />
Or via Package Manager Console:
Install-Package ktsu.ImGuiStyler
🚀 Quick Start
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!");
}
📚 Comprehensive Usage Guide
🎨 Theme Management
Applying Global Themes
// 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();
Interactive Theme Browser
// 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}");
}
Scoped Theme Application
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
🌈 Color Management
Creating Colors
// 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
Color Manipulation
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 Color Application
// 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");
}
🎯 Alignment and Layout
Content Centering
// 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));
}
Custom Container Alignment
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);
}
🔧 Advanced Styling
Scoped Style Variables
// 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");
}
Theme-Based Styling
// 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");
}
🎨 Available Themes
ImGuiStyler includes 50+ carefully crafted themes across multiple families:
🌙 Dark Themes
- Catppuccin: Mocha, Macchiato, Frappe
- Tokyo Night: Classic, Storm
- Gruvbox: Dark, Dark Hard, Dark Soft
- Dracula: Classic vampire theme
- Nord: Arctic, frost-inspired theme
- Nightfox: Carbonfox, Nightfox, Terafox
- OneDark: Popular dark theme
- Kanagawa: Wave, Dragon variants
- Everforest: Dark, Dark Hard, Dark Soft
☀️ Light Themes
- Catppuccin: Latte
- Tokyo Night: Day
- Gruvbox: Light, Light Hard, Light Soft
- Nord: Light variant
- Nightfox: Dawnfox, Dayfox
- PaperColor: Light
- Everforest: Light, Light Hard, Light Soft
- VSCode: Light theme
🎨 Specialty Themes
- Monokai: Classic editor theme
- Nightfly: Smooth dark theme
- VSCode: Dark theme recreation
🛠️ API Reference
Theme Class
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 dark
Color Class
Color.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 color
Alignment Classes
new Alignment.Center(Vector2 contentSize)
- Center in available regionnew Alignment.CenterWithin(Vector2 contentSize, Vector2 containerSize)
- Center in container
Scoped Classes
new 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 color
🎯 Demo Application
The included demo application showcases all features:
cd ImGuiStylerDemo
dotnet run
Features demonstrated:
- Interactive theme browser with live preview
- All 50+ themes with family categorization
- Scoped styling examples
- Color manipulation demos
- Alignment showcases
- Accessibility features
🤝 Contributing
We welcome contributions! Please see our contributing guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Development Setup
git clone https://github.com/ktsu-dev/ImGuiStyler.git
cd ImGuiStyler
dotnet restore
dotnet build
📄 License
This project is licensed under the MIT License - see the LICENSE.md file for details.
🙏 Acknowledgments
- ImGui.NET - .NET bindings for Dear ImGui
- Hexa.NET.ImGui - Modern ImGui bindings
- Theme Inspirations: Catppuccin, Tokyo Night, Gruvbox, and other amazing color schemes
- Community Contributors - Thank you for your themes, bug reports, and improvements!
🔗 Related Projects
- ktsu.ThemeProvider - Semantic theming foundation
- ktsu.ImGuiPopups - Modal and popup utilities
- ktsu.Extensions - Utility extensions
Made with ❤️ by the ktsu.dev team
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Hexa.NET.ImGui (>= 2.2.8.4)
- ktsu.Extensions (>= 1.5.6)
- ktsu.ImGuiPopups (>= 1.3.5)
- ktsu.ScopedAction (>= 1.1.2)
- ktsu.ThemeProvider (>= 1.0.8)
- ktsu.ThemeProvider.ImGui (>= 1.0.8)
NuGet packages (1)
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. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.3.12 | 490 | 7/23/2025 |
1.3.11 | 482 | 7/23/2025 |
1.3.10 | 485 | 7/23/2025 |
1.3.9 | 481 | 7/22/2025 |
1.3.8 | 481 | 7/22/2025 |
1.3.7 | 483 | 7/22/2025 |
1.3.6 | 486 | 7/22/2025 |
1.3.5 | 483 | 7/22/2025 |
1.3.4 | 483 | 7/22/2025 |
1.3.3 | 83 | 7/18/2025 |
1.3.3-pre.20 | 109 | 7/9/2025 |
1.3.3-pre.19 | 262 | 6/11/2025 |
1.3.3-pre.18 | 127 | 5/20/2025 |
1.3.3-pre.15 | 78 | 5/17/2025 |
1.3.3-pre.14 | 127 | 5/16/2025 |
1.3.3-pre.13 | 200 | 5/15/2025 |
1.3.3-pre.12 | 196 | 5/14/2025 |
1.3.3-pre.11 | 200 | 5/13/2025 |
1.3.3-pre.10 | 227 | 5/12/2025 |
1.3.3-pre.9 | 169 | 5/11/2025 |
1.3.3-pre.8 | 110 | 5/10/2025 |
1.3.3-pre.7 | 49 | 5/9/2025 |
1.3.3-pre.6 | 119 | 5/8/2025 |
1.3.3-pre.5 | 121 | 5/7/2025 |
1.3.3-pre.4 | 116 | 5/6/2025 |
1.3.3-pre.3 | 120 | 5/5/2025 |
1.3.3-pre.2 | 120 | 5/4/2025 |
1.3.3-pre.1 | 121 | 5/4/2025 |
1.3.2 | 440 | 5/4/2025 |
1.3.2-pre.6 | 109 | 4/29/2025 |
1.3.2-pre.5 | 51 | 4/26/2025 |
1.3.2-pre.4 | 56 | 4/25/2025 |
1.3.2-pre.3 | 124 | 4/9/2025 |
1.3.2-pre.2 | 112 | 4/4/2025 |
1.3.2-pre.1 | 127 | 3/31/2025 |
1.3.1 | 557 | 3/30/2025 |
1.3.0 | 553 | 3/30/2025 |
1.2.1 | 93 | 3/29/2025 |
1.2.1-pre.5 | 79 | 3/29/2025 |
1.2.1-pre.4 | 453 | 3/25/2025 |
1.2.1-pre.3 | 125 | 3/12/2025 |
1.2.1-pre.2 | 69 | 2/18/2025 |
1.2.1-pre.1 | 76 | 2/17/2025 |
1.2.0 | 940 | 2/17/2025 |
1.1.1-pre.1 | 77 | 2/12/2025 |
1.1.0 | 559 | 2/6/2025 |
1.0.16-pre.3 | 67 | 2/6/2025 |
1.0.16-pre.2 | 65 | 2/5/2025 |
1.0.16-pre.1 | 67 | 2/5/2025 |
1.0.15 | 646 | 1/2/2025 |
1.0.15-pre.33 | 66 | 2/3/2025 |
1.0.15-pre.32 | 69 | 2/3/2025 |
1.0.15-pre.31 | 70 | 2/3/2025 |
1.0.15-pre.30 | 70 | 2/1/2025 |
1.0.15-pre.29 | 63 | 1/30/2025 |
1.0.15-pre.28 | 64 | 1/28/2025 |
1.0.15-pre.27 | 58 | 1/26/2025 |
1.0.15-pre.26 | 61 | 1/24/2025 |
1.0.15-pre.25 | 62 | 1/22/2025 |
1.0.15-pre.24 | 56 | 1/20/2025 |
1.0.15-pre.23 | 56 | 1/18/2025 |
1.0.15-pre.22 | 57 | 1/16/2025 |
1.0.15-pre.21 | 49 | 1/15/2025 |
1.0.15-pre.20 | 41 | 1/14/2025 |
1.0.15-pre.19 | 63 | 1/13/2025 |
1.0.15-pre.18 | 59 | 1/11/2025 |
1.0.15-pre.17 | 74 | 1/10/2025 |
1.0.15-pre.16 | 58 | 1/10/2025 |
1.0.15-pre.15 | 34 | 1/9/2025 |
1.0.15-pre.14 | 38 | 1/9/2025 |
1.0.15-pre.13 | 65 | 1/5/2025 |
1.0.15-pre.12 | 84 | 1/3/2025 |
1.0.15-pre.11 | 66 | 1/3/2025 |
1.0.15-pre.10 | 70 | 1/3/2025 |
1.0.15-pre.9 | 71 | 1/3/2025 |
1.0.15-pre.8 | 73 | 1/2/2025 |
1.0.15-pre.7 | 89 | 12/31/2024 |
1.0.15-pre.6 | 64 | 12/30/2024 |
1.0.15-pre.5 | 67 | 12/29/2024 |
1.0.15-pre.4 | 64 | 12/28/2024 |
1.0.15-pre.3 | 62 | 12/27/2024 |
1.0.15-pre.2 | 74 | 12/27/2024 |
1.0.15-pre.1 | 75 | 12/27/2024 |
1.0.14-pre.1 | 66 | 12/27/2024 |
1.0.13 | 209 | 12/26/2024 |
1.0.12 | 759 | 12/26/2024 |
1.0.11 | 102 | 12/26/2024 |
1.0.10 | 147 | 12/25/2024 |
1.0.10-pre.1 | 66 | 12/27/2024 |
1.0.9 | 266 | 12/23/2024 |
1.0.8 | 120 | 12/23/2024 |
1.0.7 | 96 | 12/23/2024 |
1.0.6 | 195 | 12/22/2024 |
1.0.5 | 172 | 12/19/2024 |
1.0.4 | 135 | 12/19/2024 |
1.0.3 | 154 | 12/18/2024 |
1.0.2 | 249 | 12/16/2024 |
1.0.1 | 178 | 12/13/2024 |
1.0.0 | 213 | 12/11/2024 |
1.0.0-alpha.69 | 91 | 12/10/2024 |
1.0.0-alpha.68 | 111 | 12/9/2024 |
1.0.0-alpha.67 | 72 | 12/9/2024 |
1.0.0-alpha.66 | 125 | 12/6/2024 |
1.0.0-alpha.65 | 131 | 12/5/2024 |
1.0.0-alpha.64 | 218 | 12/2/2024 |
1.0.0-alpha.63 | 62 | 12/2/2024 |
1.0.0-alpha.62 | 80 | 12/2/2024 |
1.0.0-alpha.61 | 63 | 12/2/2024 |
1.0.0-alpha.60 | 78 | 12/1/2024 |
1.0.0-alpha.59 | 110 | 12/1/2024 |
1.0.0-alpha.58 | 89 | 11/30/2024 |
1.0.0-alpha.57 | 98 | 11/29/2024 |
1.0.0-alpha.56 | 160 | 11/27/2024 |
1.0.0-alpha.55 | 115 | 11/26/2024 |
1.0.0-alpha.54 | 166 | 11/22/2024 |
1.0.0-alpha.53 | 134 | 11/21/2024 |
1.0.0-alpha.52 | 113 | 11/20/2024 |
1.0.0-alpha.51 | 147 | 11/18/2024 |
1.0.0-alpha.50 | 89 | 11/15/2024 |
1.0.0-alpha.49 | 135 | 11/14/2024 |
1.0.0-alpha.48 | 107 | 11/13/2024 |
1.0.0-alpha.47 | 200 | 11/8/2024 |
1.0.0-alpha.46 | 113 | 11/7/2024 |
1.0.0-alpha.45 | 103 | 11/6/2024 |
1.0.0-alpha.44 | 134 | 11/4/2024 |
1.0.0-alpha.43 | 252 | 11/1/2024 |
1.0.0-alpha.42 | 297 | 10/25/2024 |
1.0.0-alpha.41 | 134 | 10/21/2024 |
1.0.0-alpha.40 | 133 | 10/17/2024 |
1.0.0-alpha.39 | 221 | 10/10/2024 |
1.0.0-alpha.38 | 165 | 10/10/2024 |
1.0.0-alpha.37 | 137 | 10/7/2024 |
1.0.0-alpha.36 | 122 | 10/4/2024 |
1.0.0-alpha.35 | 207 | 9/30/2024 |
1.0.0-alpha.34 | 125 | 9/26/2024 |
1.0.0-alpha.33 | 101 | 9/25/2024 |
1.0.0-alpha.32 | 124 | 9/23/2024 |
1.0.0-alpha.31 | 122 | 9/20/2024 |
1.0.0-alpha.30 | 108 | 9/19/2024 |
1.0.0-alpha.29 | 102 | 9/19/2024 |
1.0.0-alpha.28 | 59 | 9/19/2024 |
1.0.0-alpha.27 | 56 | 9/19/2024 |
1.0.0-alpha.26 | 51 | 9/19/2024 |
1.0.0-alpha.25 | 82 | 9/19/2024 |
1.0.0-alpha.24 | 96 | 9/18/2024 |
1.0.0-alpha.23 | 67 | 9/18/2024 |
1.0.0-alpha.22 | 113 | 9/18/2024 |
1.0.0-alpha.21 | 65 | 9/18/2024 |
1.0.0-alpha.20 | 119 | 9/18/2024 |
1.0.0-alpha.19 | 230 | 9/14/2024 |
1.0.0-alpha.18 | 68 | 9/14/2024 |
## v1.3.12 (patch)
Changes since v1.3.11:
- Enhance README and implement ScopedTheme functionality ([@matt-edmondson](https://github.com/matt-edmondson))