macos: default to sRGB color space #376
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.
Ghostty is currently using the native color space on MacOS. For some Apple devices that means DCI-P3.
When specifying a hex color, it gets mapped incorrectly, because the color space is about 25% wider. As an example:
#0000FF
needs to be shown as "maximally blue in sRGB space". P3 is a much wider gamut, and the same hex code will result in a different color, since P3 can show "more blue".A lot of useful information about this has been already written down in the following threads:
To illustrate (screenshots taken on a 2021 MacBook 14" using "Digital Color Meter"):
Ghostty before this PR in native P3 color space:
Ghostty before this PR in sRGB color space:
Ghostty after this PR in P3:
Ghostty after this PR in sRGB:
Here's a side by side with
onehalfdark
in neovim:Left is this PR, right is
main
Color schemes are generally designed with sRGB in mind. onehalf for example specifies sRGB for iTerm2 and VSCode.
Behaviour of other terminals:
onehalf
would render correctly in the terminal, but incorrectly in neovim running in the same terminal. There's also a global config option to choose which color space to use. The stable release uses sRGB.