fix!: remove broken dominant border #34
Merged
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.
Background
I was looking into spec discrepancies between local development and github CI
When running specs on ubuntu 24.04, the "dominant" border rendered using completely different and clearly wrong colour. It turns out that the entire feature is thoroughly broken.
Problems
("dominant" colour at the bottom)
(that one uses wrong sorting, "dominant" colour at the bottom)
Solution
The colorscore gem seems unmaintained, so one alternative is to reimplement dominant handling ourselves. What made the output sane to me was substituting current colorscore's command:
with the following one:
(fixed sorting and behaviour, "dominant" colour at the bottom)
Ideally natural sorting should be used to handle unpadded output.
That said, I don't expect anyone to miss that feature, so I'm just removing it, leaving the hints about possible fix here in case that's needed :) .
References
original code from colorscore
Appendix
Raw
convert
output for original command on ubuntu 24.04Raw
convert
output for original command on ubuntu 22.04 (note wrong order)