solarized
solarized copied to clipboard
Lion Terminal Commit again!
For history of this pull request refer to: https://github.com/altercation/solarized/pull/177
@willnorris @altercation @jeyb @ayoung @jedahan @Sirupsen @dchelimsky @jjungnickel Just to let you know that all the previous incarnations of this were using Tagged colours and it turns out they should have been untagged. You should find these settings will give you better contrast and look much more like the web examples.
<3
Very happy to hear that. Thanks for your work on this.
the lights and darks still seem to be reversed, as I mentioned on the other pull request. Compare the ANSI colors on these two screenshots:
- http://db.tt/RZcFAiFE (yours)
- http://db.tt/6TbU121D (what I think is correct)
For Solarized Dark, I'm pretty sure the two colors on the far left, Black and Bright Black, should be dark as in the second screenshot above. Also, https://github.com/seebi/dircolors-solarized has a good explanation of solarized in general, and why you needn't bother with the "Use bold fonts" setting in Terminal.
@willnorris - Thanks for spotting the bold issue, personally I prefer bold on but I forgot on this occasion to turn it off before submitting it.
With respect to the colour flipping, this doesn't seem to fit with my reading of the spec. though I'm more than willing to accept that I could be wrong. Can you point me to some explanation of this or give me some example of how this impacts the display?
On Ethan's main Solarized page all the examples appear to flip these colours when switching from Light to Dark theme:
Base03 <-> Base3
Base02 <-> Base2
Base01 <-> Base1
Base00 <-> Base0
and keep all the rest the same.
If I understand you correctly, you are suggesting just flipping:
Base01 <-> Base1
Base00 <-> Base0
and leaving everything else the same. This would mean that an application choosing ANSI colour 0 on the assumption that it is high contrast would find the text almost invisible in the Dark theme?
Or am I misunderstanding some aspect of Terminal. Is Terminal itself flipping these automatically based on contrast?
Whichever way, I'm happy to make it correct.
@willnorris - I've followed up on this and done some testing. If I maintain the theme as in the pull request and set some text to ANSI colour 0 and some to colour 7:
println("\u001b[30mColour 0\u001b[m - \u001b[37mColour 7\u001b[m")
Apologies that's Scala 'cause I'm a Scala head by day :)
"Colour 0" is high contrast and approx. white in the dark theme and approx. black in the light theme. "Colour 7" is equivalently low contrast appox. dark grey in dark theme and approx. light grey in light theme. Switching themes maintains this visual contrast.
This seems to me to be in the spirit of Solarized.
However, I also note that the supplied Terminal themes do not do this. So colour 0 in "Homebrew" or "Pro" theme is invisible but in "Basic" or "Novel" is high contrast. This seems to me to be a mistake with those themes, or at least a different perspective on how contrast and colour should be handled. In effect, with those themes, your software needs to be theme aware and change its selection of colours to suit.
so, I'm basing this off the way vim looks using the Ethan's vim settings and background=dark. With your terminal settings, it looks like this (note the cream colored sidebar). With my current terminal settings, it looks correct. Now, that's certainly not to say that I don't have something else screwed up on my end... clearly my vim config and my terminal config don't agree on light versus dark. It's not clear to me exactly where the problem lies.
okay, I think I'm figuring it out now. We need two Terminal settings files, one for Solarized Light and one for Solarized Dark.
For both files, the ANSI colors should be identical, based on the values specified in this chart. Note that when you hover over the ANSI Colors in the Terminal settings window, the name and number of the color appears over to the right. These coincide with the TERMCOL and left half of the 16/8 columns in the above table. So the top left color in the Terminal settings window, Black (0), should be rgb(0,43,54).
So, the ANSI colors are identical for both Terminal settings file. The only thing that is different is the Text, Bold Text, Select, Cursor, and Window Background Color. These should be copied over from the correct ANSI color to reflect the proper light vs dark themes.
Does that make sense?
Out of interest, what happens when you set background=light but use the Dark Theme?
@willnorris To be honest, I don't think that does make sense! :)
What happens when you set background=light but use the Dark Theme?
It seems that vim (which I confess to not using) uses the background setting to switch its use of colours. That's fine if you only use vim or all the other terminal apps can switch too, but unless I'm missing something they don't.
However, if it is switching colours then setting background=light and using the Dark Theme should, in theory, give you the desired result and allow you to switch themes mid-use.
S
@willnorris and I have a potential @altercation <- can you help?
I agree with @willnorris that some of the colors are flipped in @sroebuck's most recent commit (f84961bc). Specifically, it looks like "white" and "black" are swapped. Following the TERMCOL column on "The Values" table shows how the colors should align.
After working this out myself today to determine why MacVim had a darker (and correct per photoshop info) background color than Lion's Terminal.app, I made a discovery. Setting the values via sRGB yields different results than setting via HSB
Illustrated (I'm using the "blinks" theme in my zshrc, btw):

Why? Who knows. It's probably related to Apple applying some kind of conversion for color profile purposes - if you enter RGB 0,43,54 in Photoshop you actually get a color that matches the Solarized examples, so it's something in the Apple Color Picker that's mangling things.
I now have a Dark preset which appears to match the Solarized spec and also has the same colors as MacVim. You can find it in commit c3c220c789 to my personal dotfiles repo feel free to copy what you need from it to update this PR. Alternatively, here are the steps I followed to get a good (matching) result:
- Open The Values
- In the Terminal prefs pane, hover over each of the ANSI colors and note the name of the color.
- Find the value for that color and enter it as an HSB value -- NOT as RGB
- After updating all colors, be sure to set proper values for the Text, Bold Text, Selection, Cursor and (on the Window tab) Background Color. The correct values are listed here. This is important because Terminal sets these colors independently of what you set for ANSI colors!
Pic:

For fun, you'll note that if you have your values set via HSB and then switch the dropdown to RGB the values will no longer match what's in the Values table. Clearly there's some kind of modification happening that only hits you via the RGB picker.
Now that I've considered this a bit more I'd venture a guess that if you set you display profile to Generic RGB (which you definitely should not do!) then there would be no conversion of RGB values. This is likely why entering the RGB colors into Photoshop (a profile-aware application) gives expected results.
I think the following is happening:
- If you enter an RGB value the active display profile is used to convert that setting into something that will "look" right on your display...
- If you enter an HSB value the profile is not used, or perhaps it is used "in reverse" to derive RGB values
It's unclear how these values are stored (the data in the .terminal file is binary), so I'm not sure if the HSB values are being stored or if some other post-conversion value is being stored... If it's the latter then the only way to get a truly correct set of colors in Solarized is to do it manually as described above.
lol color.
Thanks for doing all that investigation and work, @thatRD ! My terminal looks great and even lolcat is working properly now thanks to the HSB scheme you created.
Okay, @thatRD, as you say the colours should not be stored as Generic RGB but, if I understand it should be stored as some form of Device RGB/HSB in order that the colours you see are adapted to the colour adjustments for your device. This is, if I understand it, what the "untagged" colours are in the Solarized Apple Color Picker which appear with a small triangle in the top right hand corner when you are viewing the colours. These are the form of colours present in this pull request, so I think the issues that remain are purely about the swapping of colours or not for Dark vs. Light theme.
It seems to me that everyone who is in favour of Light and Dark themes being exactly the same (except for the allocation of colours for specific purposes: background, text, highlight, etc.) are users of Vim in the Dark theme. I really would appreciate @altercation giving his advice on this subject because I can't understand why you would want a colour theme that requires applications to change their colours to fit with the theme.
My understanding is that the table of colours provided with Solarized is defined with the colours named for the (default) Light theme and that the dark theme requires all the base colours to be swapped by switching the 01 to 1 and 02 to 2 etc. This preserves all the contrasts as the remaining 'colours' all have the same intensity and therefore do not require to be swapped.
Nobody who has suggested that this shouldn't be so has explained how this maintains this principle for both Light and Dark themes. It would be really helpful if someone advocating that approach could give some explanation of why it makes sense other than that it works well for Vim in Dark theme with Vim preferences set background=dark.
Ah - I apologize; I guess I didn't realize that you had already figured out a fix via the untagged colors thing. The background color does seem to be correct; I'll verify again once we all agree on the ANSI color discussion.
I believe the ANSI colors should remain consistent across both Light and Dark and should match what is set in the table (the dark blues are set to BLACK/BRBLACK). It is up to the application's theme to choose appropriate ANSI values for each element they want to style <-- this is what you're doing when setting the terminal text, window background, etc, even though those are set directly and not to something in the ANSI table.
Setting the ANSI values in terminal is only meant to enable other applications to use a Solarized theme if they wish; it does not mean that they will do it properly. For example, with terminal set to Solarized Dark (and ANSI set to table values) Vim looks fine with either background=light or =dark. But, it doesn't look like Solarized unless you also set the colorscheme=solarized in Vim.
Similarly, look at several of the prompt themes/color schemes that ship with Oh-my-zsh. Many look terrible when terminal is set to Solarized. Some look good only on Dark or only on Light mode. At the Terminal level the color scheme is responsible for assigning specific colors to the various ANSI crayons. It is up to each application and their respective themes to choose crayons appropriate for their needs - and unless they are designed with a specific Solarized theme it may not look good.
@thatRD okay, but in @altercation's description of Solarized, he says:
I often switch between dark and light modes when editing text and code. Solarized retains the same selective contrast relationships and overall feel when switching between the light and dark background modes. A lot of thought, planning and testing has gone into making both modes feel like part of a unified colorscheme.
Right, and I presume he's talking about doing this from within Vim which is using his solarized colorscheme & looks good with either background=light or =dark.
At least for me, when using Solarized Dark theme on Terminal and Solarized colorscheme in Vim, I can switch between background =light and =dark with no problems. Are you seeing something different? Here's what I see:
vim
:colorscheme solarized
:set background=light

:set background=dark

The Terminal theme was not changed between those screenshots.
It would be great to have terminal.app settings files for Lion. Hoping this gets resolved soon. Thanks.
I hacked up a SIMBL plugin that switches off foreground color adjustment in Terminal.app. Solarized now looks like it was intended to look like.
This maybe can be merged or closed?