This pull request introduces the concept of Salience into the repository. Salience describes how much a color pops out and grabs your attention on a background. The wal ecosystem expects color palettes to be sorted from dimmest to brightest for dark theme (flipped for light), with the intention of assigning brighter colors to more interesting things. However, what actually ends up happening is that dimmer colors can dominate attention if they are saturated or complementary to the background hue. Sorting by salience solves this.
Assuming the user and/or their tools have properly assigned colors, there are major improvements to clarity and critical on-screen elements. This is an example with code highlighting.
I like to assign colors from least to most important as follows:
Punctuation < Context (Namesapces) < Nouns (Objects) < Verbs (Functions) < Comments < Creation (Declaration/Definition)
I haven't polished the color assignment yet for Rust, but it's good enough to demonstrate the proposal. More examples and the initial issue and discussion can be found at #186.
Sorting by brightness (Current)
image
Sorting by salience (Proposed)
image
@explosion-mental you have been given edit perms. I rebased to upstream/master but I honestly don't know if I did it correctly. I was also unable to build due to some changes in src/cache.rs (see bb6012f0e5). I also noticed that when it showed the diff, it also show all of your changes on top of mine, which was weird. I haven't done anything this big before so forgive me for any incompetence for merging. Just let me know what I need to do.
Also, when creating src/palette/saliencelight.rs, interestingly, I just copy and pasted the dark version and changed some values and functions. There's actually a LOT of shared logic, and it would benefit from merging the logic. I can work on this later, but for now you can look at everything else. If you do choose to take a look at the palette salience implementation, focus on saliencedark, as that's where I based most of my logic from, and when I refactor, will be focusing on that side.
I'm also assuming we probably want to squash everything somehow later.
This pull also introduces the potential to alter how to sample colors from the image. With a max of 16 colors that can be passed to the palette generator, we can sample colors from the lowest, highest, centered, or distributed. This results in varying contrast and intensity to the finalized palette. For dark, these palettes are dubbed lowsaliencedark, saliencedark, and highsalienedark, with saleincedark being either sampled centered or distributed depending if dark or light theme.
This pull request introduces the concept of Salience into the repository. Salience describes how much a color pops out and grabs your attention on a background. The wal ecosystem expects color palettes to be sorted from dimmest to brightest for dark theme (flipped for light), with the intention of assigning brighter colors to more interesting things. However, what actually ends up happening is that dimmer colors can dominate attention if they are saturated or complementary to the background hue. Sorting by salience solves this.
Assuming the user and/or their tools have properly assigned colors, there are major improvements to clarity and critical on-screen elements. This is an example with code highlighting.
I like to assign colors from least to most important as follows:
`Punctuation` < `Context (Namesapces)` < `Nouns (Objects)` < `Verbs (Functions)` < `Comments` < `Creation (Declaration/Definition)`
I haven't polished the color assignment yet for Rust, but it's good enough to demonstrate the proposal. More examples and the initial issue and discussion can be found at #186.
Sorting by brightness (Current)

Sorting by salience (Proposed)

@explosion-mental you have been given edit perms. I rebased to upstream/master but I honestly don't know if I did it correctly. I was also unable to build due to some changes in `src/cache.rs` (see [bb6012f0e5](https://codeberg.org/usaradark/wallust/commit/bb6012f0e5a9f3d514f61b0ce7ca0f55c45346cd)). I also noticed that when it showed the diff, it also show all of your changes on top of mine, which was weird. I haven't done anything this big before so forgive me for any incompetence for merging. Just let me know what I need to do.
Also, when creating `src/palette/saliencelight.rs`, interestingly, I just copy and pasted the dark version and changed some values and functions. There's actually a LOT of shared logic, and it would benefit from merging the logic. I can work on this later, but for now you can look at everything else. If you do choose to take a look at the palette salience implementation, focus on `saliencedark`, as that's where I based most of my logic from, and when I refactor, will be focusing on that side.
I'm also assuming we probably want to squash everything somehow later.
This pull also introduces the potential to alter how to sample colors from the image. With a max of 16 colors that can be passed to the palette generator, we can sample colors from the lowest, highest, centered, or distributed. This results in varying contrast and intensity to the finalized palette. For dark, these palettes are dubbed `lowsaliencedark`, `saliencedark`, and `highsalienedark`, with `saleincedark` being either sampled centered or distributed depending if dark or light theme.