deplorableword / textmate-solarized

TextMate theme for Solarized
http://ethanschoonover.com/solarized
440 stars 98 forks source link

Highlight selected text colour in dark theme #52

Open zanqi opened 11 years ago

zanqi commented 11 years ago

screenshot In the dark theme, the selected text colour is hardly recognizable. There seems to be some pull request for this in issue #15, but the issue is still present in the repository.

Strangely, in older version, the textmate theme that can be downloaded from the official solarized site don't have this problem.

ashenkin commented 10 years ago

Yes - I would like to second this request. I use RStudio, which uses the Ace editor, which in turn pulls its themes from textmate, which pulls the solarized theme from here. I've found that the text highlight color in Solarized Dark is barely visible, especially when you're trying to find which text is highlight in a window full of colored code.Would there be any chance of changing the Solarized Dark highlight color to be more visible?

deplorableword commented 10 years ago

Wow, I had no idea that it was being used in other editors.

I think it's the lineHighlight https://github.com/deplorableword/textmate-solarized/blob/master/Solarized%20(dark).tmTheme#L35 which needs adjusting.

Feel free to pick a new colour from the pallet http://ethanschoonover.com/solarized and submit a pull request :)

jibsen commented 10 years ago

I believe lineHighlight is used for highlighting the line the cursor is on, and base02 appears correct for this.

The question is which color to use for highlighting selected text. selection in the dark theme is also set to base02, which is giving the hard to see highlighting of selected text.

The problem is that there doesn't seem to be a consensus on how to highlight selected text in Solarized. The official repository contains a number of different choices:

The Sublime Text version uses the inverse color, i.e. the light background color is used to highlight selected text in the dark theme. This has the advantage of letting other syntax highlighting work, but the disadvantage of being unpleasantly high contrast (see SublimeColors/Solarized#29).

Ideally, @altercation would chime in so we knew what the intended combination was for this (I don't know if we can assume the Vim theme by him serves as a reference implementation).

deplorableword commented 10 years ago

I did use the Vim theme as a reference, but over time TM specific tweaks have been added. I'm not sure there is 100% right answer, but we should pick colours provides good contrast in a range of situations and languages.

On Saturday, 12 July 2014, Jørgen Ibsen notifications@github.com wrote:

I believe lineHighlight is used for highlighting the line the cursor is on, and base02 appears correct for this.

The question is which color to use for highlighting selected text. selection in the dark theme is also set to base02, which is giving the hard to see highlighting of selected text.

The problem is that there doesn't seem to be a consensus on how to highlight selected text in Solarized. The official repository contains a number of different choices:

  • Gedit uses base02 on base0
  • Qt Creator uses base02 on base01
  • Vim uses base03 on base01
  • Visual Studio uses base00 on base2

The Sublime Text version uses the inverse color, i.e. the light background color is used to highlight selected text in the dark theme. This has the advantage of letting other syntax highlighting work, but the disadvantage of being unpleasantly high contrast (see SublimeColors/Solarized#29 https://github.com/SublimeColors/Solarized/pull/29).

Ideally, @altercation https://github.com/altercation would chime in so we knew what the intended combination was for this (I don't know if we can assume the Vim theme by him serves as a reference implementation).

— Reply to this email directly or view it on GitHub https://github.com/deplorableword/textmate-solarized/issues/52#issuecomment-48814302 .

Tom Martin twitter.com/deplorableword devart.org

jibsen commented 10 years ago

Looking over TextMate themes, I wonder if it is only possible to set the background color of the highlight (the selection key in settings), and not the foreground color?

The problem is that the three colors between the text and background color (base00, base01, base02) are too close to either the background or the text color -- either the selection is hard to see, or the selected text is hard to read (and in the case of base01, comments are invisible).

If you use a color from the other end of the range (base2, base3) the selection is easy to see, but the contrast between the selected text and the normal background is (to me at least) unpleasantly high. Also, in the case of base2, the normal text color is not that easy to read. Here is an example using base2:

sublime_ror_selection_base2_z

In Sublime Text, it is possible to set the foreground color of selected text as well as the background (there is a selectionForeground key). This is what the sample looks like in Sublime Text, with the selection set to be base03 on base00:

sublime_ror_selection_z

It's readable, still easy to spot what is selected, but you have to live without syntax highlighting inside the selection when you set the foreground color as well.

Perhaps the TextMate developers would be willing to add support for selectionForeground?

jibsen commented 10 years ago

I contacted TextMate support about this issue, and from their answer I gather that due to the way text is rendered, it is not trivial to implement selectionForeground, and it is not something they are likely to work on unless there is demand for it.

So if you are interested in it, I would suggest letting them know.

ashenkin commented 10 years ago

Thanks for following this up, jibsen. I'll let them know I'm interested in it. Do you think that selectionForeground is really the best (and perhaps only) solution for the problem?

jibsen commented 10 years ago

Thanks.

It is certainly not the only solution. For instance you could add a selectionBorder that lets you choose the color of a border drawn around the highlighted background color to make it easier to see. Sublime Text has this option as well, it looks like this

sublime_ror_selection_border_z

It has some problems of its own though, for instance when you select a word, other occurrences of that words are highlighted, and you can extend your selection with the next occurrence using Ctrl-D. If I select the word format in line 3 of the example, and press Ctrl-D once to select the next occurrence, I get this

sublime_ror_selection_border_problem_z

as you can see, it's hard to tell which of the borders contain selected words and which do not. Contrast this with the same using the selectionBackground solution

sublime_ror_selection_base2_noprob_z

I don't know if this problem is also present in TextMate.

Another option would be to find a color outside the Solarized palette and use that for selection background. But it is not easy to find a color that fits with the rest of them and on which all syntax highlighting is easy to read.

I think it is individual preference what works best. To me it is important to be able to clearly spot selected text, so I like the selectionBackground method.

ashenkin commented 10 years ago

I agree about the selectionBackground. In the program I use - RStudio - they have a bright blue selection when you select text with your mouse:

2014-08-15 16_42_13-d__documents_lachonta_data_r - 2010_census_data_integration - rstudio

Not especially pretty, but you can definitely see it!

I'm not a designer, and don't have an especially good eye for these things. I wouldn't mind something that doesn't entirely fit, but that you definitely see, as I think selections are relatively rare events and won't end up stressing your eyes much. But again, that's just me. I suppose better to find something that fits and is visible, but if it's a choice between the former and the latter, I guess I'd choose the latter.

Really what I'd choose is for something better to be implemented in TextMate. I'm not sure what they're open to.

lotard commented 9 years ago

My guess based on analogy to light theme: the color of highlight and outline in the dark theme should be the background color of the solarized light theme.

Would be great if someone fixed that...

jzadra commented 7 years ago

It's insane that the colors for various attributes in Rstudio are still not user configurable. The themes are awful.