If you live in the terminal, kitty is made for you! Cross-platform, fast, feature-rich, GPU based.
Implements modern wide gamut color formats with CSS Color Module Level 4 gamut mapping, addressing PR feedback with Go implementation, performance benchmarks, and reorganized documentation. Features: - OKLCH (perceptually uniform color space) - CIE LAB (device-independent color space) - CSS Color 4 compliant gamut mapping algorithm - Inline comment support in color config parsing Addressing PR Feedback: 1. Go Implementation (tools/utils/style/): - Complete OKLCH and LAB parsing with gamut mapping - Matches Python implementation structure - Comprehensive test suite (all tests passing) - Performance benchmarks showing acceptable overhead 2. Performance Benchmarks: - OKLCH: ~4.6 µs/op - LAB: ~1.5 µs/op - 10 mixed colors: ~13 µs total - Typical config (50 colors): <0.5ms startup impact 3. Documentation Reorganization: - Moved detailed color docs to docs/wide-gamut-colors.rst - Configuration docs now link to separate documentation - Reduces size of main configuration documentation Gamut Mapping: - Binary search chroma reduction from CSS Color Module Level 4 - Preserves lightness and hue while reducing chroma for out-of-gamut colors - Uses deltaE OK (JND threshold: 0.02) for perceptual difference - Ensures graceful degradation on sRGB displays Python Implementation: - parse_oklch(): OKLCH color parsing with gamut mapping - parse_lab(): CIE LAB parsing with gamut mapping via OKLCH conversion - lab_to_oklch(): LAB to OKLCH conversion for consistent gamut mapping - oklch_to_srgb_gamut_map(): CSS Color 4 gamut mapping algorithm - srgb_to_oklab(): Reverse conversion for deltaE calculations - deltaE_ok(): Perceptual color difference in OKLab space Go Implementation: - colorspaces.go: All color space conversions and gamut mapping - wrapper.go: ParseColor() updated to support OKLCH and LAB - Comprehensive test coverage with benchmarks - Matches Python implementation behavior Robustness: - NaN and infinity validation in all color parsing functions - Defense-in-depth with validation at parsing and gamut mapping levels - Returns None/error for invalid input (consistent error handling) - Validates before clamping operations to prevent NaN propagation Files changed: - Python: kitty/rgb.py, kitty_tests/datatypes.py (+250 lines) - Go: tools/utils/style/colorspaces.go, wrapper.go (+350 lines, tests) - Docs: docs/wide-gamut-colors.rst (moved from inline) - Config: kitty/options/definition.py (simplified, links to docs) References: - CSS Color Module Level 4: https://www.w3.org/TR/css-color-4/ - OKLCH Color Space: https://bottosson.github.io/posts/oklab/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .github | ||
| 3rdparty | ||
| bypy | ||
| docs | ||
| gen | ||
| glad | ||
| glfw | ||
| kittens | ||
| kitty | ||
| kitty_tests | ||
| logo | ||
| shell-integration | ||
| terminfo | ||
| tools | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| __main__.py | ||
| benchmark.py | ||
| Brewfile | ||
| build-terminfo | ||
| CHANGELOG.rst | ||
| CONTRIBUTING.md | ||
| count-lines-of-code | ||
| dev.sh | ||
| embeds.go | ||
| go.mod | ||
| go.sum | ||
| INSTALL.md | ||
| key_encoding.json | ||
| LICENSE | ||
| Makefile | ||
| publish.py | ||
| pyproject.toml | ||
| README.asciidoc | ||
| rsync-and-build.sh | ||
| SECURITY.md | ||
| session.vim | ||
| setup.py | ||
| shell.nix | ||
| staticcheck.conf | ||
| test.py | ||
| update-on-ox | ||
= kitty - the fast, feature-rich, cross-platform, GPU based terminal If you live in the terminal, *kitty* is made for **you**! See https://sw.kovidgoyal.net/kitty/[the kitty website]. image:https://github.com/kovidgoyal/kitty/workflows/CI/badge.svg["Build status", link="https://github.com/kovidgoyal/kitty/actions?query=workflow%3ACI"] https://sw.kovidgoyal.net/kitty/faq/[Frequently Asked Questions] To ask other questions about kitty usage, use either the https://github.com/kovidgoyal/kitty/discussions/[discussions on GitHub] or the https://www.reddit.com/r/KittyTerminal[Reddit community] Packaging status in various repositories: image:https://repology.org/badge/vertical-allrepos/kitty-terminal.svg?columns=3&header=kitty["Packaging status", link="https://repology.org/project/kitty-terminal/versions"]