Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ This is the **ktsu ImGui Suite**, a collection of .NET libraries for building De

### Libraries

- **ImGui.App** (`ktsu.ImGuiApp`) - Application foundation with windowing, rendering, font/texture management, PID frame limiting, DPI awareness
- **ImGui.Widgets** (`ktsu.ImGuiWidgets`) - Custom UI components: TabPanel, Knob, SearchBox, RadialProgressBar, Grid, DividerContainer, Combo, Tree, Icons, ColorIndicator, Text, Image, ScopedDisable, ScopedId
- **ImGui.Popups** (`ktsu.ImGuiPopups`) - Modal dialogs: MessageOK, Prompt, InputString/Int/Float, FilesystemBrowser, SearchableList
- **ImGui.Styler** (`ktsu.ImGuiStyler`) - Theming system with 50+ built-in themes, scoped styling, Button.Alignment, Text.Color semantic colors, Indent utilities, Alignment helpers, color palettes, and interactive theme browser
- **ImGui.App** (`ktsu.ImGui.App`) - Application foundation with windowing, rendering, font/texture management, PID frame limiting, DPI awareness
- **ImGui.Widgets** (`ktsu.ImGui.Widgets`) - Custom UI components: TabPanel, Knob, SearchBox, RadialProgressBar, Grid, DividerContainer, Combo, Tree, Icons, ColorIndicator, Text, Image, ScopedDisable, ScopedId
- **ImGui.Popups** (`ktsu.ImGui.Popups`) - Modal dialogs: MessageOK, Prompt, InputString/Int/Float, FilesystemBrowser, SearchableList
- **ImGui.Styler** (`ktsu.ImGui.Styler`) - Theming system with 50+ built-in themes, scoped styling, Button.Alignment, Text.Color semantic colors, Indent utilities, Alignment helpers, color palettes, and interactive theme browser
- **NodeGraph** (`ktsu.NodeGraph`) - UI-agnostic attribute-based node graph metadata: `[Node]`, `[InputPin]`, `[OutputPin]`, `[NodeExecute]`, `[NodeBehavior]`, pin type utilities
- **ImGuiNodeEditor** (`ktsu.ImGuiNodeEditor`) - ImNodes-based visual node editor with `NodeEditorEngine`, `AttributeBasedNodeFactory`, physics-based layout, `NodeEditorRenderer`, `NodeEditorInputHandler`

Expand Down
20 changes: 10 additions & 10 deletions ImGui.App/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# ktsu.ImGuiApp
# ktsu.ImGui.App

> A .NET library that provides application scaffolding for Dear ImGui, using Silk.NET and Hexa.NET.ImGui.

[![NuGet](https://img.shields.io/nuget/v/ktsu.ImGuiApp.svg)](https://www.nuget.org/packages/ktsu.ImGuiApp/)
[![NuGet](https://img.shields.io/nuget/v/ktsu.ImGui.App.svg)](https://www.nuget.org/packages/ktsu.ImGui.App/)
[![License](https://img.shields.io/github/license/ktsu-dev/ImGuiApp.svg)](LICENSE.md)
[![NuGet Downloads](https://img.shields.io/nuget/dt/ktsu.ImGuiApp.svg)](https://www.nuget.org/packages/ktsu.ImGuiApp/)
[![NuGet Downloads](https://img.shields.io/nuget/dt/ktsu.ImGui.App.svg)](https://www.nuget.org/packages/ktsu.ImGui.App/)
[![GitHub Stars](https://img.shields.io/github/stars/ktsu-dev/ImGuiApp?style=social)](https://github.com/ktsu-dev/ImGuiApp/stargazers)

## Introduction
Expand All @@ -27,33 +27,33 @@ ImGuiApp is a .NET library that provides application scaffolding for [Dear ImGui
- **Lifecycle Callbacks**: Customizable delegate callbacks for application events
- **Menu System**: Easy-to-use API for creating application menus
- **Positioning Guards**: Offscreen positioning checks to keep windows visible
- **Modern .NET**: Supports .NET 9 and newer
- **Modern .NET**: Supports .NET 8, 9, and 10
- **Active Development**: Open-source and actively maintained

## Getting Started

### Prerequisites

- .NET 9.0 or later
- .NET 8.0 or later

## Installation

### Package Manager Console

```powershell
Install-Package ktsu.ImGuiApp
Install-Package ktsu.ImGui.App
```

### .NET CLI

```bash
dotnet add package ktsu.ImGuiApp
dotnet add package ktsu.ImGui.App
```

### Package Reference

```xml
<PackageReference Include="ktsu.ImGuiApp" Version="x.y.z" />
<PackageReference Include="ktsu.ImGui.App" Version="x.y.z" />
```

## Usage Examples
Expand All @@ -63,7 +63,7 @@ dotnet add package ktsu.ImGuiApp
Create a new class and call `ImGuiApp.Start()` with your application config:

```csharp
using ktsu.ImGuiApp;
using ktsu.ImGui.App;
using Hexa.NET.ImGui;

static class Program
Expand Down Expand Up @@ -272,7 +272,7 @@ The system automatically:
### Full Application with Multiple Windows

```csharp
using ktsu.ImGuiApp;
using ktsu.ImGui.App;
using Hexa.NET.ImGui;
using System.Numerics;

Expand Down
52 changes: 25 additions & 27 deletions ImGui.Popups/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ImGuiPopups
# ktsu.ImGui.Popups

[![Version](https://img.shields.io/badge/version-1.3.5-blue.svg)](VERSION.md)
[![NuGet](https://img.shields.io/nuget/v/ktsu.ImGui.Popups?logo=nuget)](https://nuget.org/packages/ktsu.ImGui.Popups)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE.md)

A comprehensive library for custom popup windows and modal dialogs using ImGui.NET, providing a rich set of UI components for interactive applications.
Expand Down Expand Up @@ -36,23 +36,23 @@ A comprehensive library for custom popup windows and modal dialogs using ImGui.N

### Package Manager Console
```powershell
Install-Package ktsu.ImGuiPopups
Install-Package ktsu.ImGui.Popups
```

### .NET CLI
```bash
dotnet add package ktsu.ImGuiPopups
dotnet add package ktsu.ImGui.Popups
```

### PackageReference
```xml
<PackageReference Include="ktsu.ImGuiPopups" Version="1.3.5" />
<PackageReference Include="ktsu.ImGui.Popups" Version="x.y.z" />
```

## Quick Start

```csharp
using ktsu.ImGuiPopups;
using ktsu.ImGui.Popups;

// Create popup instances (typically as class members)
private static readonly ImGuiPopups.MessageOK messageOK = new();
Expand Down Expand Up @@ -141,26 +141,23 @@ Advanced file and directory browser:
```csharp
var browser = new ImGuiPopups.FilesystemBrowser();

// Open file
browser.Open(
title: "Open File",
mode: FilesystemBrowserMode.Open,
target: FilesystemBrowserTarget.File,
startPath: Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
onConfirm: path => OpenFile(path),
patterns: new[] { "*.txt", "*.md" } // Optional file filters
);
// Open a file (the optional glob filters which files are shown)
browser.FileOpen("Open File", path => OpenFile(path), glob: "*.txt");

// Save file
browser.Open(
title: "Save File",
mode: FilesystemBrowserMode.Save,
target: FilesystemBrowserTarget.File,
startPath: currentDirectory,
onConfirm: path => SaveFile(path)
);
// Save a file
browser.FileSave("Save File", path => SaveFile(path), glob: "*.txt");

// Choose a directory
browser.ChooseDirectory("Select Folder", dir => UseDirectory(dir));

// Render the browser each frame in your ImGui loop
browser.ShowIfOpen();
```

> File callbacks receive an `AbsoluteFilePath` and directory callbacks an `AbsoluteDirectoryPath`
> (from `ktsu.Semantics.Paths`). Each `FileOpen`/`FileSave`/`ChooseDirectory` overload also
> accepts a `Vector2 customSize`.

### Custom Modal
Create custom modal dialogs:

Expand Down Expand Up @@ -219,9 +216,9 @@ inputInt.Open("Enter Age", "Age (1-120):", 25, result => {
The repository includes a comprehensive demo application showcasing all components:

```bash
git clone https://github.com/ktsu-dev/ImGuiPopups.git
cd ImGuiPopups
dotnet run --project ImGuiPopupsDemo
git clone https://github.com/ktsu-dev/ImGuiApp.git
cd ImGuiApp
dotnet run --project examples/ImGuiPopupsDemo
```

## Dependencies
Expand All @@ -230,7 +227,8 @@ dotnet run --project ImGuiPopupsDemo
- [ktsu.Extensions](https://www.nuget.org/packages/ktsu.Extensions/) - Utility extensions
- [ktsu.CaseConverter](https://www.nuget.org/packages/ktsu.CaseConverter/) - String case conversion
- [ktsu.ScopedAction](https://www.nuget.org/packages/ktsu.ScopedAction/) - RAII-style actions
- [ktsu.StrongPaths](https://www.nuget.org/packages/ktsu.StrongPaths/) - Type-safe path handling
- [ktsu.Semantics.Paths](https://www.nuget.org/packages/ktsu.Semantics.Paths/) - Type-safe path handling
- [ktsu.Semantics.Strings](https://www.nuget.org/packages/ktsu.Semantics.Strings/) - Type-safe string wrappers
- [ktsu.TextFilter](https://www.nuget.org/packages/ktsu.TextFilter/) - Text filtering utilities
- [Microsoft.Extensions.FileSystemGlobbing](https://www.nuget.org/packages/Microsoft.Extensions.FileSystemGlobbing/) - File pattern matching

Expand Down
87 changes: 50 additions & 37 deletions ImGui.Styler/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ImGuiStyler 🎨
# ktsu.ImGui.Styler 🎨

[![Version](https://img.shields.io/badge/version-1.3.10-blue.svg)](VERSION.md)
[![NuGet](https://img.shields.io/nuget/v/ktsu.ImGui.Styler?logo=nuget)](https://nuget.org/packages/ktsu.ImGui.Styler)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE.md)

**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.
Expand Down Expand Up @@ -35,22 +35,22 @@
Add ImGuiStyler to your project via NuGet:

```xml
<PackageReference Include="ktsu.ImGuiStyler" Version="1.3.10" />
<PackageReference Include="ktsu.ImGui.Styler" Version="x.y.z" />
```

Or via Package Manager Console:
```powershell
Install-Package ktsu.ImGuiStyler
Install-Package ktsu.ImGui.Styler
```

## 🚀 Quick Start

```csharp
using ktsu.ImGuiStyler;
using ktsu.ImGui.Styler;
using Hexa.NET.ImGui;

// Apply a global theme
Theme.Apply("TokyoNight");
Theme.Apply("Tokyo Night");

// Use scoped styling for specific elements
using (new ScopedColor(ImGuiCol.Text, Color.FromHex("#ff6b6b")))
Expand All @@ -72,16 +72,15 @@ using (new Alignment.Center(ImGui.CalcTextSize("Centered!")))
#### Applying Global Themes
```csharp
// Apply any of the 50+ built-in themes
Theme.Apply("Catppuccin.Mocha");
Theme.Apply("Gruvbox.Dark");
Theme.Apply("Catppuccin Mocha");
Theme.Apply("Gruvbox Dark");
Theme.Apply("Tokyo Night");

// Get current theme information
// Get the name of the currently applied theme
string? currentTheme = Theme.CurrentThemeName;
bool isCurrentThemeDark = Theme.IsCurrentThemeDark;

// Reset to default ImGui theme
Theme.Reset();
Theme.ResetToDefault();
```

#### Interactive Theme Browser
Expand All @@ -101,12 +100,16 @@ if (Theme.RenderThemeSelector())

#### Scoped Theme Application
```csharp
using (new ScopedTheme("Dracula"))
// ScopedTheme takes an ISemanticTheme instance; resolve one by name from the registry
ISemanticTheme dracula = Theme.FindTheme("Dracula")!.CreateInstance();
ISemanticTheme nord = Theme.FindTheme("Nord")!.CreateInstance();

using (new ScopedTheme(dracula))
{
ImGui.Text("This text uses Dracula theme");
ImGui.Button("Themed button");
using (new ScopedTheme("Nord"))

using (new ScopedTheme(nord))
{
ImGui.Text("Nested Nord theme");
}
Expand All @@ -127,21 +130,26 @@ ImColor blueWithAlpha = Color.FromHex("#0066ffcc");
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
// From HSL (hue, saturation, lightness)
ImColor purple = Color.FromHSL(0.83f, 1.0f, 0.5f);
```

#### Color Manipulation

Color manipulation is provided as extension methods on `ImColor`:

```csharp
ImColor baseColor = Color.FromHex("#3498db");

// Adjust brightness
ImColor lighter = Color.Lighten(baseColor, 0.3f);
ImColor darker = Color.Darken(baseColor, 0.2f);
ImColor lighter = baseColor.LightenBy(0.3f);
ImColor darker = baseColor.DarkenBy(0.2f);

// Accessibility-focused text color (best contrast over baseColor)
ImColor optimalText = baseColor.CalculateOptimalContrastingColor();

// Accessibility-focused text colors
ImColor optimalText = Color.GetOptimalTextColor(baseColor);
ImColor contrastText = Color.GetContrastingTextColor(baseColor);
// WCAG contrast ratio between two colors
float ratio = optimalText.GetContrastRatioOver(baseColor);
```

#### Scoped Color Application
Expand Down Expand Up @@ -346,23 +354,29 @@ ImGuiStyler includes **50+ carefully crafted themes** across multiple families:
## 🛠️ API Reference

### Theme Class
- `Theme.Apply(string themeName)` - Apply a global theme
- `Theme.Apply(string themeName)` - Apply a global theme (returns `false` if not found)
- `Theme.Apply(ISemanticTheme theme)` - Apply a semantic theme
- `Theme.Reset()` - Reset to default ImGui theme
- `Theme.ResetToDefault()` - Reset to default ImGui theme
- `Theme.ShowThemeSelector(string title)` - Show theme browser modal
- `Theme.RenderThemeSelector()` - Render theme browser (returns true if theme changed)
- `Theme.AllThemes` - Get all available themes
- `Theme.RenderMenu(string menuLabel)` - Render a theme selection menu
- `Theme.FindTheme(string name)` - Look up a theme by name (returns `ThemeInfo?`)
- `Theme.AllThemes` / `Theme.DarkThemes` / `Theme.LightThemes` - Available themes
- `Theme.Families` - Get all theme families
- `Theme.CurrentThemeName` - Get current theme name
- `Theme.IsCurrentThemeDark` - Check if current theme is dark

### Color Class
- `Color.FromHex(string hex)` - Create color from hex string
- `Color.FromRGB(int r, int g, int b)` - Create color from RGB
- `Color.FromRGBA(int r, int g, int b, int a)` - Create color from RGBA
- `Color.GetOptimalTextColor(ImColor background)` - Get accessible text color
- `Color.Lighten(ImColor color, float amount)` - Lighten color
- `Color.Darken(ImColor color, float amount)` - Darken color
- `Color.FromRGB(byte r, byte g, byte b)` - Create color from RGB
- `Color.FromRGBA(byte r, byte g, byte b, byte a)` - Create color from RGBA
- `Color.FromHSL(float h, float s, float l)` - Create color from HSL

### Color Extension Methods (on `ImColor`)
- `color.LightenBy(float amount)` - Lighten color
- `color.DarkenBy(float amount)` - Darken color
- `color.WithAlpha(float amount)` - Set alpha channel
- `color.CalculateOptimalContrastingColor()` - Get accessible (max-contrast) text color
- `color.GetContrastRatioOver(ImColor background)` - WCAG contrast ratio

### Alignment Classes
- `new Alignment.Center(Vector2 contentSize)` - Center in available region
Expand All @@ -372,7 +386,7 @@ ImGuiStyler includes **50+ carefully crafted themes** across multiple families:
- `new ScopedColor(ImGuiCol col, ImColor color)` - Scoped color application
- `new ScopedTextColor(ImColor color)` - Scoped text color
- `new ScopedStyleVar(ImGuiStyleVar var, float value)` - Scoped style variable
- `new ScopedTheme(string themeName)` - Scoped theme application
- `new ScopedTheme(ISemanticTheme theme)` - Scoped theme application
- `new ScopedThemeColor(Color semanticColor)` - Scoped semantic color

### Button Class
Expand All @@ -396,8 +410,7 @@ ImGuiStyler includes **50+ carefully crafted themes** across multiple families:
The included demo application showcases all features:

```bash
cd ImGuiStylerDemo
dotnet run
dotnet run --project examples/ImGuiStylerDemo
```

Features demonstrated:
Expand All @@ -420,8 +433,8 @@ We welcome contributions! Please see our contributing guidelines:

### Development Setup
```bash
git clone https://github.com/ktsu-dev/ImGuiStyler.git
cd ImGuiStyler
git clone https://github.com/ktsu-dev/ImGuiApp.git
cd ImGuiApp
dotnet restore
dotnet build
```
Expand All @@ -440,8 +453,8 @@ This project is licensed under the **MIT License** - see the [LICENSE.md](LICENS
## 🔗 Related Projects

- **[ktsu.ThemeProvider](https://github.com/ktsu-dev/ThemeProvider)** - Semantic theming foundation
- **[ktsu.ImGuiPopups](https://github.com/ktsu-dev/ImGuiPopups)** - Modal and popup utilities
- **[ktsu.Extensions](https://github.com/ktsu-dev/Extensions)** - Utility extensions
- **[ktsu.ImGui.Popups](https://nuget.org/packages/ktsu.ImGui.Popups)** - Modal and popup utilities (part of this suite)
- **[ktsu.ImGui.Widgets](https://nuget.org/packages/ktsu.ImGui.Widgets)** - Custom widgets (part of this suite)

---

Expand Down
Loading