feat(color-scale): Add EZA_MAX_LUMINANCE env var like EZA_MIN_LUMINANCE #1380
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Some people can't focus light text on a dark background well. For accessibility, this commit adds a maximum luminance environment variable setting similar to the existing minimum luminance setting to keep the color-scale range readable on light backgrounds.
There are also a couple of trivial typos fixed in the documentation of the luminance max/min environment variables.
How Has This Been Tested?
It has been run with both default settings and the new
EZA_MAX_LUMINANCE
option set to various values on both MacOS and Arch Linux;EZA_MIN_LUMINANCE
was also varied in tests especially on MacOS.It passes cargo tests and does not produce any new output from cargo clippy.
I tried to run the nix integration tests inside a
nixos/nix
docker container with the flake feature turned on, but, although I could getnix develop
to run, basically all other nix commands failed with permission errors on directories that didn't exist (eg/.cache
), even with an unmodified eza checkout. I know nothing about nix and stopped at this point. As far as I can tell there aren't any existing tests of the color scale code anyway, but I am a relative novice at Rust so may have missed something.