mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-10-06 05:57:38 -04:00
If gui.authorColors names no color for an author, lazygit picks one from a hash of their name, at an HSL lightness between 0.4 and 0.6. HSL lightness says nothing about how bright a color looks, though. At 0.5 a yellow is glaring and a blue is nearly black, so whether an author's initials can be read comes down to where their name happens to hash to. Against a background of #1e1e1e, 45% of four thousand names fall below a contrast ratio of 4.5:1 and 21% below 3:1, with the worst at 1.46:1. Several issues have been raised about author colors being too dark to read. Use HSLuv instead. Its lightness tracks perceived brightness, so the range can be narrow now that a number in it means something. Against #1e1e1e, every author now lands between 4.7:1 and 7.7:1, so no name is unlucky any more. This changes the color of every author who isn't named in gui.authorColors. On a light background, the new colors are uniformly too pale, where before they were mostly too pale. The next commit gives a light background a range of its own. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>