solarized icon indicating copy to clipboard operation
solarized copied to clipboard

iTerm2 Color Scheme is Wrong

Open dovej opened this issue 11 years ago • 11 comments

I reported a color accuracy issue a while back: https://github.com/altercation/solarized/issues/215

I did some more investigating today. It seems that the colors in iTerm2 are just way off. I took out the Digital ColorMeter and compared the solarized website in Chrome, Emacs GUI, and iTerm2. The hex values on the site in Chrome seem to all match up according to ColorMeter. The ones in Emacs don't quite match up, but are close in most instances. The ones in iTerm2 are just way off...I tried going into iTerm2, clicking the colors, and clicking on the Hex tab, and indeed they are way off. By checking screenshots that others have posted of iTerm2 in other issues, I can confirm that other people are seeing the same off colors that I'm seeing.

I ask the following out of curiosity, and don't mean to come off rude: why does it seem so difficult for people to create consistent solarized color themes? I mean, they are RGB values, no? It just feels like they are slightly different in every context I see them, and that's really annoying for a project that is literally about very specific colors...

dovej avatar May 12 '13 00:05 dovej

So, not being experienced in this color stuff, I realized that I was using the "native values" in Digitial ColorMeter, and figured it'd make sense to try other options including sRGB and L* a* b. Once again, I found the website in Chrome and Emacs to be pretty close on most things. However, now it was a bit more debatable as to which was a better match to the listed values (neither was spot on). iTerm2 was still significantly off.

dovej avatar May 12 '13 04:05 dovej

@dovej I've found that I must manually change the Report Terminal Type to "xterm-color", which is not a listed option to get accurate colors in iTerm2. I've written to them about this and they still haven't added the option by default. You can find it in Preferences > Profiles > Terminal > Report Terminal Type, it's a drop down menu.

muub avatar Jul 30 '13 17:07 muub

@muub I'm not sure that we are talking about the same issue here. I am saying that the color profile itself is off. I also have since noticed how much this is dependent on the color profile of the working display/monitor, but I have reason to believe that the iTerm2 one may be objectively off. What you seem to be referring to is the phenomenon where having a certain $TERM affects the color schemes of certain applications like emacs. (I fixed this by manually modifying those themes to deal with xterm-256color and still use the ANSI codes.) Unless I am mistaken about what you are describing. What I am referring to is examining the colors in Profiles > Colors pref pane itself.

dovej avatar Jul 30 '13 18:07 dovej

Multiple issues with iTerm2 color themes, see for yourself:

Solarized Dark.itermcolors

Solarized Light.itermcolors

skull-squadron avatar Mar 02 '14 08:03 skull-squadron

As a workaround, I used Solarized Darcula from http://iterm2colorschemes.com/

skull-squadron avatar Mar 02 '14 08:03 skull-squadron

iTerm2's colors are definitely wrong here. Check out the difference between Terminal and iTerm2 that I see in Vim:

OS X Terminal:

iTerm2:

The background color in both of them is ANSI 236, which is supposed to be 0x303030. Color picker tells me that the color is spot on in Terminal and way off in iTerm2 (at 0x3f3f3f). I haven't found any settings that explain why the colors look so washed out.

I get the correct color for 236 if I use this command to set 236 to 0x242424, but I definitely don't want to manually tweak 256 colors.

echo -ne "\x1bP\x1b]4;236;rgb:24/24/24\a\x1b\\"

wilywampa avatar Mar 19 '14 01:03 wilywampa

I wrote a little script to tweak all the colors. I source this in my .zshrc and it looks much better now - maybe even closer to the GUI than Terminal for my colorscheme. The first 16 lines are commented out because they are the 16 colors available without xterm-256color and they seem to look fine with the defaults.

https://gist.github.com/wilywampa/9698143

wilywampa avatar Mar 21 '14 22:03 wilywampa

@wilywampa this seems to have made a difference in the color differences for me thanks! You can use it with iterm2 by adding it to .bash_profile.

alexkehayias avatar Apr 13 '14 19:04 alexkehayias

I think I've recently observed a similar "issue" with color reporting in iTerm. The hex codes reported in the Profiles > Colors settings were always lighter than I thought they were supposed to be. For instance, a background color that was supposed to be #2d2d2d was said to be #3b3b3b by iTerm. I also used Digital Color Meter (on OS X) and was getting #3b3b3b. This was all very confusing because the repo from which I got the theme said the color was #2d2d2d. But upon analyzing the screenshots of the theme in that same repo with Digital Color Meter, I also got #3b3b3b.

I was thinking maybe my screen's colors were off, so I tried calibrating my screen, but saw no difference. Anyway, going back to Digital Color Meter, I tried switching the color profile to Generic RGB and, what do you know, It's reporting the expected hex colors! Thus, my conclusion is that iTerm interprets theme colors using the Generic RGB color space and then converts them to sRGB, which is why the hex codes shown in iTerm are different.

I'm not sure if this is related to @dovej's issue, but it sounds like this may be the cause of the problem observed by @wilywampa.

fvgs avatar Mar 22 '16 08:03 fvgs

EDIT:

There is certainly a conversion issue here, running the background of a default iTerm with solarized dark through a color meter tool reports the sRGB value of 0, 40, 51. When we open the background color in the settings of iTerm it states the sRGB value of 0, 40, 51 so that is not the problem. It is however not yet the expected 0, 43, 54 but it might be a conversion issue due to the float (is that what it is?) to int color conversion in the itermcolors format.

NinoFloris avatar Jul 09 '16 00:07 NinoFloris

Open iTerm2 issue on this subject.

The maintainers comments suggest that @fvgs is correct:

Is it the background color in the screenshot you're asking about? That difference is explainable by color spaces. If you change "sRGB" to "Calibrated" in that plist file it should go back to how 2.x rendered it.

JamesMcMahon avatar Dec 03 '16 02:12 JamesMcMahon