Commit Graph

16946 Commits

Author SHA1 Message Date
Jökull Sólberg
64abd87a9e Add wide gamut color support with OKLCH and LAB formats
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>
2025-12-27 14:34:34 +00:00
Kovid Goyal
0fb54d32b1 Fix #9323 2025-12-24 16:35:10 +05:30
Kovid Goyal
0fd3a18121 ... 2025-12-24 12:15:16 +05:30
Kovid Goyal
c26b770530 version 0.45.0 v0.45.0 2025-12-24 09:24:17 +05:30
Kovid Goyal
ef4e6f97bc ... 2025-12-24 09:19:52 +05:30
Kovid Goyal
df32684afd Update choose files docs 2025-12-24 09:17:24 +05:30
Kovid Goyal
44efa30679 ... 2025-12-23 15:50:55 +05:30
Kovid Goyal
eb43aacb02 Update changelog 2025-12-23 12:25:48 +05:30
Kovid Goyal
c00e41ecee Merge branch 'dependabot/github_actions/actions-97f38a5d32' of https://github.com/kovidgoyal/kitty 2025-12-22 09:06:06 +05:30
dependabot[bot]
232edb3ad3 Bump actions/cache from 4 to 5 in the actions group
Bumps the actions group with 1 update: [actions/cache](https://github.com/actions/cache).


Updates `actions/cache` from 4 to 5
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-22 03:22:12 +00:00
Kovid Goyal
915a878a0a Merge branch 'update-wayland-compat-matrix' of https://github.com/alex-huff/kitty 2025-12-22 08:43:50 +05:30
Kovid Goyal
291c08758f Merge branch 'dependabot/go_modules/all-go-deps-4b4744f558' of https://github.com/kovidgoyal/kitty 2025-12-22 08:43:20 +05:30
dependabot[bot]
9bd447d4e7 Bump the all-go-deps group with 2 updates
Bumps the all-go-deps group with 2 updates: [golang.org/x/image](https://github.com/golang/image) and [golang.org/x/text](https://github.com/golang/text).


Updates `golang.org/x/image` from 0.33.0 to 0.34.0
- [Commits](https://github.com/golang/image/compare/v0.33.0...v0.34.0)

Updates `golang.org/x/text` from 0.31.0 to 0.32.0
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.31.0...v0.32.0)

---
updated-dependencies:
- dependency-name: golang.org/x/image
  dependency-version: 0.34.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-go-deps
- dependency-name: golang.org/x/text
  dependency-version: 0.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-22 03:03:37 +00:00
alex-huff
59cf17f2be docs: panel: update river compatibility information 2025-12-21 12:17:56 -06:00
Kovid Goyal
0ad032c0d2 Merge branch 'fix-9017' of https://github.com/flaviut/kitty 2025-12-21 08:18:33 +05:30
Flaviu Tamas
811cd5870b fix #9017 2025-12-20 18:31:30 -05:00
Kovid Goyal
e368ce0d52 Fix docs build breakage 2025-12-20 09:13:02 +05:30
Kovid Goyal
5b0b714baa Update changelog 2025-12-20 09:10:39 +05:30
Kovid Goyal
b9e75ac301 Add matplotlib as a requirement for docs 2025-12-20 09:07:19 +05:30
Kovid Goyal
06e7f5ec37 Fix #9306 2025-12-20 08:54:22 +05:30
Kovid Goyal
fd9d49a438 Make mypy happy 2025-12-19 11:57:48 +05:30
Kovid Goyal
315fa53198 Add active tab history to @ ls output
Useful for tools wanting to list tabs in MRU order.
Fixes #9303
2025-12-19 11:46:12 +05:30
Kovid Goyal
4f73374a12 YATB: Yet Another Tahoe Bug from the company that should stick to selling fruit
Fixes #9299
2025-12-18 11:13:38 +05:30
Kovid Goyal
99b1eca3c8 Disable NSAutoFillHeuristicController on spec 2025-12-18 10:16:59 +05:30
Kovid Goyal
8bf2f439c8 Merge branch 'nyan-icon' of https://github.com/mtklr/kitty 2025-12-18 08:22:47 +05:30
Matt K
0a0a575a57 add nyancat app icon 2025-12-17 17:10:34 -05:00
Kovid Goyal
562b4ee9ed More docs 2025-12-16 19:46:44 +05:30
Kovid Goyal
5b5ba91aa9 Merge branch 'dependabot/go_modules/all-go-deps-85d9a9ac9a' of https://github.com/kovidgoyal/kitty 2025-12-15 09:02:58 +05:30
dependabot[bot]
75bff944ef Bump the all-go-deps group with 3 updates
Bumps the all-go-deps group with 3 updates: [github.com/klauspost/compress](https://github.com/klauspost/compress), [github.com/nwaples/rardecode/v2](https://github.com/nwaples/rardecode) and [golang.org/x/sys](https://github.com/golang/sys).


Updates `github.com/klauspost/compress` from 1.18.1 to 1.18.2
- [Release notes](https://github.com/klauspost/compress/releases)
- [Commits](https://github.com/klauspost/compress/compare/v1.18.1...v1.18.2)

Updates `github.com/nwaples/rardecode/v2` from 2.2.1 to 2.2.2
- [Commits](https://github.com/nwaples/rardecode/compare/v2.2.1...v2.2.2)

Updates `golang.org/x/sys` from 0.38.0 to 0.39.0
- [Commits](https://github.com/golang/sys/compare/v0.38.0...v0.39.0)

---
updated-dependencies:
- dependency-name: github.com/klauspost/compress
  dependency-version: 1.18.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-go-deps
- dependency-name: github.com/nwaples/rardecode/v2
  dependency-version: 2.2.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-go-deps
- dependency-name: golang.org/x/sys
  dependency-version: 0.39.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 03:03:38 +00:00
Kovid Goyal
322904b339 Update changelog 2025-12-14 20:07:52 +05:30
Kovid Goyal
0ecee7dcca macOS: Workaround for regression in Tahoe 26.2 that breaks --detach
Fixes #9288
2025-12-14 19:42:57 +05:30
Kovid Goyal
8fc5ab235e Merge branch 'fix-typos' of https://github.com/shfc/kitty 2025-12-14 18:10:59 +05:30
shfc
51a08d23cd fix: typos in documentation 2025-12-14 22:42:24 +10:30
Kovid Goyal
399354cbe5 Fix tab_bar_min_tabs not tab_bar_filter
Fixes #9278
2025-12-12 17:11:43 +05:30
Kovid Goyal
94106aa79e Add dawn to the list of integrations 2025-12-12 00:41:41 +05:30
Kovid Goyal
f39183bd6b Ignore inapplicable CVE 2025-12-11 12:49:16 +05:30
Kovid Goyal
0837fd548d Update changelog 2025-12-11 11:21:43 +05:30
Kovid Goyal
1f07fa766e Simplify API 2025-12-10 08:55:06 +05:30
Kovid Goyal
025dccf182 Micro optimization: When sending cell uniform data dont even map the color table region in memory unless the color table is dirty 2025-12-10 08:49:02 +05:30
Kovid Goyal
8448f737ae More comprehensive reset of color profile on screen reset 2025-12-09 08:18:36 +05:30
Kovid Goyal
f1cc676ea6 ... 2025-12-08 20:47:20 +05:30
Kovid Goyal
f2102c9c89 Merge branch 'dependabot/go_modules/all-go-deps-511620664e' of https://github.com/kovidgoyal/kitty 2025-12-08 08:39:21 +05:30
dependabot[bot]
bf8ad53fad Bump github.com/shirou/gopsutil/v4 in the all-go-deps group
Bumps the all-go-deps group with 1 update: [github.com/shirou/gopsutil/v4](https://github.com/shirou/gopsutil).


Updates `github.com/shirou/gopsutil/v4` from 4.25.10 to 4.25.11
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v4.25.10...v4.25.11)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v4
  dependency-version: 4.25.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-08 03:04:10 +00:00
Kovid Goyal
7e5226f5e2 Merge branch 'webp-optimize' of https://github.com/starsep/kitty 2025-12-07 22:12:53 +05:30
Filip Czaplicki
34776469e0 Optimize quake webp screenshots
I noticed that screenshots load slowly at
https://sw.kovidgoyal.net/kitty/kittens/panel/

I used https://squoosh.app/ with webp default settings
2025-12-07 17:32:33 +01:00
Kovid Goyal
f38127b20a Nicer formatting for exe_search_path in debug output 2025-12-07 13:39:38 +05:30
Kovid Goyal
424199bb5a Bump version of libpng for CVE 2025-12-07 11:45:13 +05:30
Kovid Goyal
1b8d780c5a Nicer function name 2025-12-06 10:12:23 +05:30
Kovid Goyal
244002a9eb ... 2025-12-06 10:11:04 +05:30
Kovid Goyal
2b5117f014 Fix #9271 2025-12-06 10:06:05 +05:30