$ show navarasu/onedark.nvim
onedark.nvim is a Neovim 0.9+ colorscheme plugin implementing the Atom One Dark and One Light themes with Lua and TreeSitter support. The codebase provides 8 theme styles (dark, darker, cool, deep, warm, warmer, light), comprehensive TreeSitter highlight definitions (modern @-prefixed captures), LSP semantic token integration, and support for over 24 plugins (nvim-cmp, telescope, lualine, indent-blankline, etc.). It includes a robust test suite with automated highlight group verification and manual visual testing files. The architecture is modular: palette.lua defines raw color values per style, colors.lua selects and merges with user overrides, highlights.lua maps groups to colors with configurable code styles (italic, bold), and init.lua handles setup/loading/toggling. The utility module provides reusable color blending functions. The repository is actively maintained with frequent releases, detailed changelogs, and responsive issue triage. While primarily a Neovim plugin, its color handling and test patterns could inspire similar theme implementations.
The LLM identified 3 files worth highlighting for reuse:
Self-contained Lua module providing hex-to-RGB conversion, color blending, and lighten/darken functions. The blend function takes foreground and background hex strings and an alpha (0-1) to produce a blended color. Darken and lighten are convenience wrappers. This module has zero internal dependencies and can be extracted into any Lua project for color manipulation, making it a reusable utility.
A pure data table defining 7 color palettes (dark, darker, cool, deep, warm, warmer, light) with consistent keys (bg0, fg, red, green, etc.). Each palette contains ~25 named colors. This structure is trivially extractable and can serve as a template for other colorschemes or theming systems. It demonstrates clean separation of color definitions from application logic.
Automated test script for verifying highlight group existence and properties in a Neovim colorscheme. It defines reusable assertion helpers (assert_highlight_exists, assert_highlight_has_property) and a test runner pattern that can be adapted to test any Neovim colorscheme's highlight groups. The script runs headless and exits with non-zero on failure, suitable for CI/CD integration.