Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
16 changes: 16 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Summary

<!-- Brief description of your changes -->

## Checklist

- [ ] I have **not** included the built theme files `lua/tinted-nvim/palettes/*.lua` or `colors/*.vim`
- [ ] I have run `just fmt` to format my code
- [ ] I have run `just lint` and fixed any issues
- [ ] I have run `just test` and all tests pass
- [ ] I have run `just docs` if I changed any LuaDoc annotations
- [ ] I have updated CHANGELOG.md (if applicable)

## Test plan

<!-- How did you test your changes? -->
74 changes: 74 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI

on:
push:
branches: main
pull_request:
branches: main

jobs:
lint:
name: Lint and Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-24.11

- name: Cache Nix store
uses: cachix/cachix-action@v15
with:
name: nix-community
skipPush: true

- name: Run luacheck
run: nix develop --command just lint

- name: Check formatting
run: nix develop --command just fmt-check

test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-24.11

- name: Cache Nix store
uses: cachix/cachix-action@v15
with:
name: nix-community
skipPush: true

- name: Run tests
run: nix develop --command just test

# Ensure generated files are not included in PR since these will be built on merge to main
check-generated:
name: Check Generated Files
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check for changes to generated files
run: |
CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- 'lua/tinted-nvim/palettes/*.lua' 'colors/*.vim')
if [ -n "$CHANGED" ]; then
echo "::error::Generated files should not be modified in PRs:"
echo "$CHANGED"
echo ""
echo "These files are auto-generated. Please revert changes to:"
echo " - lua/tinted-nvim/palettes/*.lua"
echo " - colors/*.vim"
exit 1
fi
36 changes: 36 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Docs

on:
push:
branches: main
pull_request:
branches: main

jobs:
check:
name: Check Vimdoc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-24.11

- name: Cache Nix store
uses: cachix/cachix-action@v15
with:
name: nix-community
skipPush: true

- name: Generate docs
run: nix develop --command just docs

- name: Check for uncommitted changes
run: |
if ! git diff --quiet doc/tinted-nvim.txt; then
echo "::error::Vimdoc is outdated. Run 'just docs' and commit the changes."
git diff doc/tinted-nvim.txt
exit 1
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
doc/tags
.DS_Store
16 changes: 16 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
globals = {
"vim",
}

read_globals = {
"describe",
"it",
"before_each",
"assert",
}

-- Allow unused arguments with underscore prefix or common patterns
unused_args = false

-- Max line length
max_line_length = 120
20 changes: 20 additions & 0 deletions .luarc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"diagnostics": {
"globals": [
"vim",
"describe",
"it",
"before_each",
"after_each",
"spy",
"mock",
"stub"
]
},
"workspace": {
"library": [
"${3rd}/busted/library",
"${3rd}/luassert/library"
]
}
}
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Changelog

## [0.1.0] - 2026-02-01

### Added

- **Modular architecture**: Complete rewrite with clean module separation (`config`, `colors`, `compile`, `selector`, `highlights`, `terminal`, `aliases`, `utils`)
- **Compile-to-bytecode**: Compile schemes to Lua bytecode for faster startup with `compile = true`
- **External selector**: Read scheme from file, environment variable, or command output
- **File watcher**: Automatically reload scheme when selector file changes (with `watch = true`)
- **Color transforms**: `darken` and `lighten` functions for fine-tuning colors in highlight overrides
- **Color aliases**: Use semantic names like `red`, `background`, `foreground` instead of `base08`, `base00`, `base05`
- **Highlight integrations**: Built-in support for telescope, notify, cmp, blink, dapui, lualine
- **Lazy.nvim highlight specs**: Define highlights in plugin specs with `use_lazy_specs = true`
- **User-defined schemes**: Create custom Base16/Base24 schemes in config
- **Scheme overrides**: Override specific colors of existing schemes
- **Style customization**: Configure text attributes for comments, keywords, functions, variables, types
- **UI options**: `transparent` background and `dim_inactive` windows
- **Terminal colors**: Proper Base16/Base24 to ANSI color mapping with Base24 bright color support
- **Commands**: `:TintedNvimCompile` and `:TintedNvimClearCache`
- **API functions**: `get_scheme()`, `get_palette()`, `get_palette_aliases()`
- **Test suite**: Comprehensive tests using vusted
- **Type annotations**: LuaDoc comments throughout codebase

### Changed

- **Module structure**: Moved from `lua/tinted-colorscheme.lua` monolith to `lua/tinted-nvim/` directory with separate modules
- **Palette location**: Moved from `lua/colors/` to `lua/tinted-nvim/palettes/`
- **Configuration**: New `setup()` options structure (see README.md)
- **API**: Changed from property access (`tinted.palette`) to function calls (`tinted.get_palette()`)

### Removed

- **Old highlight system**: Replaced `M.highlight` metatable with declarative highlight builders
- **Direct Tinty dependency**: Replaced with generic selector system that works with any scheme source

### Fixed

- Proper `vim.g.colors_name` handling
- ColorScheme autocmd firing with suppression option
- Base24 bright color fallbacks to Base16 equivalents
Loading