Merged
Conversation
f81a594 to
c4c2119
Compare
faacad2 to
a8b8fae
Compare
Member
Author
|
The associated REPL PR: JuliaLang/julia#59958 |
96b8ccf to
5da5a96
Compare
9b31697 to
7e5812f
Compare
Member
Author
|
I'm about to start pushing some unrelated changes that build on this work. Once I've sorted out what goes in what patches, and the commit order, I'll adjust this PR to be scoped to just recolouring again and put the remaining changes in a separate PR. For now, here are the just-recolouring changes: https://github.com/JuliaLang/StyledStrings.jl/compare/9bb8ffdd8c2858cced7b6b6fcee85be41c9a1867..7e5812fb50191628079735bc30eaf2fde5a9dfa1 |
kdheepak
reviewed
Nov 9, 2025
565a163 to
bb4d995
Compare
5f8b929 to
921b63b
Compare
When making terminal-friendly interfaces, it is easy to run into the limits of 4-bit ANSI colouring. This is easily seen when trying to show selections or highlighting, and a shaded background is required. Without knowing if the terminal is light or dark, and what shades its ANSI colours are, it is not possible to pick an appropriate colour. To generate appropriate colours, some form of blending is required. Instead of encouraging packages to just pick a colour, or do ad-hoc blending themselves, it makes sense for us to provide a single colour blending function that does a good job: here, by transforming the sRGB colour into OKLab space to do the blending in, and then back to sRGB at the end. This extra work pays off in markedly better results. While terminal colour detection and retheming is left for later, this work together with the base colours lays the foundation for consistently appropriate colouring.
This will make it easier to reapply modifications after recolouring.
These were never supposed to make the cut in the first place.
Member
Author
|
I think that this is a good start, and that we can refine the approach more before this is released with Julia 1.14. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The road to appropriate colours across the wide range of colour schemes and light/dark variability of the terminals people use, and for when 4-bit ANSI colours aren't sufficient.