New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set_color can't use all "ANSI" colors on background #1464
Comments
This same thing just tripped me up. I'm using a base16 color scheme which stores additional colors I want to use in the 'bright' palette |
@skattyadz Hi. You too want to use the bright palette for background colors? Could this be done using |
If you look at the image below you'll see that my terminal color scheme stores some custom colors in the 8-15 range. I'd like to be able to use these colors in my prompt I'm sure it's a rare use case, but wanted maintainers to know that being able to specify by |
Mmm, I see. It is not about your terminal supporting these colors, because you could always Question. How can you access the other colors without specifying the hex value? |
Ah, I see. The terminal scheme stores the color codes in Fish color variables.
Yes, this is correct. |
I am having the same issue. Would love to be able to reference colors by number so I can use colors 8-15 from my base16 theme as a background. |
+1 I would opt for ditching the
That should ease the implementation of full ANSI palette support a lot, as you won't need to figure out how to literary combine |
I have the same issue. Is the use case of using base16 really so rare? |
I moved to neovim so this isn't an issue for me any more — adam On Mon, Nov 2, 2015 at 11:37 AM, Daniel Pfeifer notifications@github.com
|
I use base16 but I doesn't found any problem with it. I also uses neovim but I hate that it's colors is a bit different from the 256 colors. If I recall correctly, fish can use true colors. Try |
That only works when the terminal (or emulator) supports true colors. |
That's true, of course I am using a terminal that support true colors. Nowdays, a lot of terminal support true colors. You could look at: https://gist.github.com/XVilka/8346728 |
See on Wikipedia - ANSI color standard specifies a possibility of 16-color palette, of which all colors should be referrable whether as foreground or background colors, i.e. there is a distinction between foreground/background and normal/bold. I think "true color" support is irrelevant, as the usage of relative color palette allows for a unified look between CLI applications without explicit manual theming. |
I prefer a prompt where each segment (e.g., hostname, git branch name) uses a distinct background color as it stands out more clearly against the colored output of other commands like Also, the current table is incorrect in assigning the label "white" to palette entry 7 which is actually light grey. Palette entry 15 is white. I'm ambivalent about adding support for referencing all palette entries by index using a scheme like |
This adds support for the ANSI x3.64 "bright" colors in the basic sixteen color palette. This is especially useful when trying to use the base colors as a background color. The "bright" variants tend to be more useful as background colors compared to the non-bright variants. This also fixes a bug in so far as palette number 7 is actually grey and not white whereas palette number 15 is white. At least on the terminal emulators on which I've tested this change (Ubuntu xterm & uxterm, Mac OS X Terminal & iTerm2). Resolves issue #1464.
@Walther, or anyone else who has commented on this issue, can this be closed? The change I made to support the "bright" variants has been merged and is working for me. If someone feels strongly about adding support for referencing the 256 color palette by index I think a new issue should be opened by someone willing to write the code to implement it. |
Closing. Thanks krader! |
I've been trying to create a somewhat dynamic theme, that would instead of hardcoded hex values refer to the terminal's own "ANSI" colors.
However, it isn't possible to use a bold/bright variant (the latter 8 of the 16 palette) as a background color with
set_color
.Screenshot example:

Expected results: the "bold/bright" variant of green should be the backround color in the third and fourth line. Instead, third line does not work at all, and fourth results in bold/bright foreground and the background is the "normal" green.
On foreground (the first line), it is possible to access the "bold/bright" variants of ANSI colors specified by the terminal.
Suggestion: allow referring to "ANSI" colors with
color0
-color15
or something similar, instead of relying to-o
/--bold
, or alternatively, allow-o
/--bold
parsing also for the background colors.(spacecolors.sh borrowed with <3 from here)
The text was updated successfully, but these errors were encountered: