Repository navigation
Color problems after #10554 #10852
Issue DescriptionAfter #10554, my colors have changed in ways I don't understand. This may be my problem or the problem of some of the other tools I use, but the most obvious problem is that 231 (white) has become black! See screenshot below (taken with the minimal config listed below). 231 is the black square directly above 237.
Please let me know if I can do anything else to help debug this. Expected BehaviorColor 231 (white) should be white. Actual BehaviorColor 231 (white) is now black. Reproduction Steps
Ghostty LogsNo response Ghostty VersionOS Version InformationmacOS 26.3 (Linux only) Display ServerNone (Linux only) Desktop Environment/Window ManagerNo response Minimal Ghostty Configuration# black
palette = 0=#000000
# dark red
palette = 1=#800000
# dark green
palette = 2=#194a1f
# dark yellow
palette = 3=#808000
# dark blue
palette = 4=#000075
# dark magenta
palette = 5=#8b008b
# dark cyan
palette = 6=#469990
# grey
palette = 7=#c5c6c8
# dark grey
palette = 8=#737373
# red
palette = 9=#d20f2c
# green
palette = 10=#3cb44d
# yellow
palette = 11=#ffe119
# blue
palette = 12=#4363d8
# magenta
palette = 13=#f032e6
# cyan
palette = 14=#42d4f4
# white
palette = 15=#ffffff
shell-integration-features = no-cursor,title,sudo
# Base colors and cursor styles.
background = #ffffff
foreground= #090909Additional Relevant ConfigurationNo response I acknowledge that:
|
Replies: 10 comments 70 replies
|
The gradients look reversed, my quick guess is that light mode isn't handled correctly…? cc @jake-stewart. |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
#10554 fixes a problem I've had with Neovim: it's impossible to explicitly tell Neovim to use the background and foreground colors of the terminal emulator. Under the new regime those just become hard coded as 16 and 231; likewise for the grayscale ramp where you can estimate the distance from foreground & background based on the number. Nice for moving forward. However, it's worth noting that the standard assumption is that 16 is black, 231 is white, and the grayscale ramp goes from "almost black" to "almost white". Under the new regime both the values and the direction of the ramp (and the cube) depend on the theme. Not nice for backward compatibility. |
|
Okay, okay, thanks for all the context here. Here's kind of where I'm thinking. Conceptually, I think @jake-stewart's arguments for color 16 and so on make sense. I get what he's saying. It does, however, break a lot of assumptions of the cube/ramp direction. And I think things like the link to Wikipedia that showcase the palette highlight this because I think people will semantically think black (for n=16) and not background. There's nowhere I can find that says to consider the 256 color palette 16-231 as "background => foreground". That is unfortunate for reasons stated by @jake-stewart, but I think backwards compatibility is important here. We can't introduce new, useful semantic meaning onto an existing very old protocol that is widely used. There is a new, relatively widely adopted protocol for light/dark mode detection. I think the best we can do is document that those programs should detect this and invert the palette themselves. I know that puts more work on the program, and @jake-stewart's approach would make this work automatically, but I still don't think the 256 palette -- being so legacy -- should break legacy programs by default. I can see there being space for some kind of new sequence that tells the terminal that "hey, I want a semantic palette" or something, that is better adjusted to themes automatically. But, I don't think we should this by default. So my concrete proposal is to eliminate the inversion and bg => fg ramp and do a more typical dark => light ramp (still taking into account bg/fg, but keeping 16 black and 231 white). I think this is the only way we can really make this a default on feature. I think this would address all the negative reactions we've gotten to it. Open to thoughts here. |
|
Bringing #10554 (comment) to the main discussion as another data point. For me it changed my tmux colors unexpectedly. Not a big issue, I can choose a different color, but I had my status bar set to the color Eigengrau After #10554 My tmux config for the theme is as follows: I'm not very familiar with the lower level terminal settings for colors, etc, but if there's more information needed I'd be happy to provide that as well. Thanks! |
|
I tested this after #10877. It doesn't fix my color theme issue with vim + gruvbox8. Here is my .vimrc settings Ghostty config With |
|
I don't have a huge amount of context of what change happened in this release, but my zsh prompt was unusually desaturated when I booted up ghostty this morning - this is outside of vim, just the home prompt, using Andromeda theme. ghostty config: This is how it looked before the update: After, note how it is significantly desaturated:
Setting |
|
I updated to 504a361 yesterday (which includes 0eaf77d, ...if it was not reverted), and noticed that colors are now... Incorrect? First in micro, then in tmux over ssh (launching tmux with My Ghostty config: macos-option-as-alt = left
macos-titlebar-proxy-icon = hidden
macos-titlebar-style = tabs
window-colorspace = display-p3
scrollback-limit = 1000000000
cursor-style = bar
shell-integration-features = no-cursor
theme = iTerm2 Smoooooth
font-family = Iosevka
font-size = 17
auto-update-channel = tip
keybind = alt+backspace=text:\x1b\x7f
keybind = shift+enter=text:\n |
|
Hi all, just chiming in here. Perhaps a bit late. I am the author of several standalone TUIs and related ansi coloring libraries, including some that do automatic theme detection. I have one non-trivial TUI that I've written in typescript, ruby, rust, go, and now zig. Zig is a pain because as far as I know there isn't (yet) a library for background color detection... Anyway, It's easy to run into trouble with ANSI 16. As soon as you invert a color things fall apart. For example, recent versions of Codex were unreadable in certain dark palettes like solarized because it made assumptions about the ANSI 16 colors. If a behemoth like OpenAI can't make that work, who can? Sometimes you just have to bite the bullet and use ANSI truecolor. Want to show your errors as red on white? Avoid ANSI 16, use truecolor. ANSI 256 is poorly understood and rarely used IMO. I think this is because the color set is lightly documented and inconsistently named, at least as compared to ANSI 16 and truecolor. The industry has been trained on CSS & RGB. Personally I've mainly used ANSI 256 to save bytes vs truecolor. ANSI 256 white/black speed up your app! The other important use case is fallback for terminals that don't support truecolor. Libraries like lipgloss will automatically pick the closest ANSI256 if truecolor is not supported. I love the idea behind a custom 256 palette, but I'm worried that it will make ANSI 256 even less popular. If I can't count on white/black I'm not sure I can continue to use it. As an aside, IMO there is tons of room for innovation with ansi coloring. Personally I would love to make theming faster and easier. The lipgloss color API is a delight but it requires many escape codes to get the job done. Plus you gotta use golang. We can do better, I think. |
|
I've decided, at least for 1.3.0, to keep the functionality but make it opt-in. More details here: #11067 |















Hi @telemachus
This was caused by the new 256-color palette generation. You can read the motivation behind this change here.
The extended palette is generated by default but manually set colors are never replaced. You can put
palette-generate = falsein your config to disable the feature entirely.The gradients are reversed for light mode but this is completely on purpose. (@00-kat)
Color 16 should not be thought of as black. Instead, it is the background with no shades of color applied. For a black terminal, this does end up being black. For a white terminal, it should be white.
This framing difference allows the palette to be used semantically. For example, you may want a subtle red bac…