$ show aarzilli/nucular
Nucular is an immediate-mode GUI library for Go, ported from the C library nuklear. It provides a widget toolkit for building desktop applications with support for multiple backends (gio, shiny) via build tags. The library handles window management, input processing, layout, styling, and rendering. Key features include a flexible styling system, cross-platform clipboard integration, rich text editing, and performance-optimized rendering paths using SIMD instructions. Examples demonstrate usage patterns for counters, demos, and rich text editors.
The LLM identified 3 files worth highlighting for reuse:
Provides embedded asset access (e.g., fonts) with automatic gzip decompression and SIMD-accelerated alpha compositing. Demonstrates CPU feature detection (CPUID) to enable AVX-optimized loops for high-performance pixel operations, abstracting asset loading via a simple, reusable interface.
Defines a cross-platform clipboard interface with platform-specific implementations (Darwin, Windows, X11, fallback). Encapsulates OS-specific clipboard operations behind a common Go interface, enabling seamless cut/copy/paste functionality across desktop platforms with minimal client code changes.
Implements a flexible theming system for GUI widgets, allowing scalable styles (colors, padding, borders) that adapt to different resolutions and user preferences. Centralizes appearance configuration and supports runtime theme switching, demonstrating clean separation of presentation logic from widget behavior.