feat(theme): add color0-color255 syntax and fix 256-color palette, Fi…#2199
Open
Samyra312007 wants to merge 1 commit into
Open
feat(theme): add color0-color255 syntax and fix 256-color palette, Fi…#2199Samyra312007 wants to merge 1 commit into
Samyra312007 wants to merge 1 commit into
Conversation
: profanity-im#2081 Signed-off-by: Samyra312007 <samayra312007@gmail.com>
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.
Fixes: #2081
Summary
Add
color0tocolor255syntax support for addressing all 256 terminal colors by number, and fix the 256-color palette to match the actual xterm specification.Changes
src/config/color.cFixed color values: Replaced all 256 HSL values in the
color_names[]array with correct values derived from the standard xterm 256-color palette:redwashsl(0,100%,25%)=#800000, nowhsl(0,100%,40%)=#CD0000)rgb({0,95,135,175,215,255})rgb(8,8,8)torgb(238,238,238))gold1(index 220) washsl(0,100%,50%)= pure red, nowhsl(51,100%,50%)= correct goldAdded
colorNsyntax: Enhancedfind_col()to parsecolor0throughcolor255(case-insensitive), returning the numeric index directly. This solves the "fewer than 256 accessible colors" problem caused by duplicate names (e.g.,blue3at indices 19 and 20).src/ui/console.c/theme colours: Replaced outdated help text with clear instructions on usingcolor0tocolor255and the standard xterm colour names.Backward Compatibility
.themefiles continue to work without modificationcolorNsyntax is purely additiveHow to test the functionality
meson setup build_run -Dtests=true && meson compile -C build_runmeson test -C build_run/theme colours— verify the updated help text appears.themefile: