-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define guidelines #6
Comments
IMO:
|
Maybe you can make a "quick and dirty" tag system, where you have multiple Since you're starting from scratch you can impose it on every new PR, and if someone really wants to have color themes with only xterm 256-color palette (totally random example, of course) they can directly look for the list in that file. The issue with that solution is that you can't search efficiently for multiple "tags" at once. Another solution would be to add the "tags" in the header of included colorschemes (if you plan on including the |
I think we can use the labelling system for that. |
Here are the tags I can think of:
Is there something missing? |
I think it is not unreasonable to try to offer:
We need a minimum of 8 colorschemes to cover the whole spectrum. |
The saturation in the colors gives a different feel too : Big saturation in the colors feel like looking at a rainbow, while low saturation is like looking at a grayscale scheme (you can still have low sat / high contrast - like apprentice or the best example is actually an emacs-theme : modus-operandi and modus-vivendi try really hard for this| low sat / low contrast - like gray on white | high sat / low contrast - like gruvbox light soft variant | high sat / high contrast - like vim-snazzy or vim-gotham) |
@gagbo good points, adding saturation to the list. |
I think:
|
This is a heavy requirement. I don't like it because:
I think we should try this distribution:
Agreed. |
The docs on background say:
and:
This means background can be used to customize theme, if theme is implemented correctly, and suggests that themes can automatically select their version (light, dark) depending on whether terminal is light or dark. I think built-in themes should show the way and use these possibilities, even if there will be less of them available |
Conversely:
|
For me it makes no sense to force each theme to have a light and dark variant. You can also keep small and lean color files, and ask the users to actually type I don't use Vim that much these days, but as a random theme maker, I can tell that "having to" build 2 palettes is just going to end up with one side being a lot worse and with a lot less effort. |
@sheerun the only purpose of
|
This is nearly impossible to achieve, the exploitable dynamic range on a light background is extremely limited compared to a dark background. This is the best I could come up with when I tried to come up with a light version of Iosvkem , and I gave up on it because I simply could not get good enough separation between colours :
The only way this can work is if the themes were made to only use the xterm palette. It also makes the issue I outlined above significantly worse, as there's no massaging that can be done anymore to get colours to feel right. There are only 2 reliable ways to deal with this problem :
|
Then maybe for each theme we could somehow designate opposite-color version, even if it's another theme |
Honestly, I don't see what the point of arbitrarily associating different themes would be. Providing useable full-featured low contrast and high saturation light background themes doesn't seem like a possibility to me, especially if we have to pluck the colours out of the xterm palette. |
Okay I guess. So making things concrete what about:
So total of 20 themes in which 10 light, 10 dark, 12 normal contrast, 4 high contrast, 4 low contrast |
@neutaaaaan all good points. @sheerun, the exact numbers can't really be set in stone at the moment but those proportions—or something close—seem okay-ish to me. The actual numbers and proportions will, in fine, depend on the proposals we get, though. |
I've thought about it some more, this is going to be pretty long : Complete backwards compatibility is unrealistic. 16cThe first 16 colors of a terminal emulator are defined by the terminal emulator, the specific distribution or flavor of The main issue will be the inevitable overloading of colors within specific contexts. 88cThis is a fairly similar situation, but at least we get bold characters back and we can be sure that red will be red and so on. 256c and truecolorWill be bikeshedded to death, and then some more. The first thing that needs to be settled is whether the truecolor themes should all be restricted to the xterm palette, and if not, whether having different themes for 256c and TC is a possibility or not. |
My opinion is that the default colorschemes shouldn't break, no matter where you use them. "Shouldn't break" is not the same as "works" or "works perfectly in the most optimal way", though. Where Vim doesn't break, built-in colorschemes shouldn't break either. Italics are indeed not universally available. Falling back to "normal" would probably be acceptable but falling back to "reverse", for example, would break the colorscheme. I would like to test that in as many environments as possible before striking italics out. I agree that colors 0-15 can't be trusted at all. The color names are only indicative of the platform/app defaults, the indices are different on some platforms, the user can set the value of "Cyan" to any color he wants, etc. but Vim will inevitably be used in 8c or 16c environments so colorscheme authors have to make some assumptions, not to guarantee that their colorscheme works, but to guarantee that it doesn't break. I, too, have written one of the very few (at the time) colorschemes that used the xterm palette for both We need to strike a balance between total creative freedom and neurotic backward compatibility. |
My own version of "shouldn't break" is "will always meet some specified baseline behaviour no matter what".
I don't expect anyone to side with me on the issue of whether it should be comprehensive like bruin is, or stripped down to the bone like my own t_co=0 fallback, but there's a pretty hard set list of features that cannot be expected to work, ever, in that context, and to me that's what the baseline should be. |
Color support grading:
Grade A environments are the easiest to support: just use Grade B environments are not easy to support because the xterm palette is not expressive enough and programmatic conversion from true colors to xterm is lossy by definition and can't be trusted anyway. Grade C environments are too few. I'm not sure it should be considered relevant. Grade D environments are often older versions of A or B environments. Grade E environments are few but I'd consider the Linux virtual console to be pretty relevant. Grade F environments, well… are ancient history but supporting them should be possible by default. |
For those, one might define a single if !exists('&t_Co') || empty(&t_Co) || &t_Co <= 2
runtime colors/dumb
endif This would alleviate developers from the burden of supporting a corner case and would guarantee that any color scheme would not break in limited environments. Such About italics, the approach used by disco.vim to detect italics has worked well for me, but I don't know how foolproof it is. Anyway, I think that one has to be pragmatic, and be happy with color schemes that “do not break most of the time”. Again, a possible approach is to generalize the above and have one “bulletproof” color scheme (or one for dark and one for light background) to fallback to when certain baseline requirements are not met. |
@brammool AFAIK, the "definitive" resource about true colors is still
https://gist.github.com/XVilka/8346728.
Currently reading ncurses's doc about RGB and setaf/setab.
Hmm, the trick to set the color and then read it back seems the most
reliable. It's similar to what we do for 'ambiwidth' and recently to
check if requesting the cursor properties work.
Would need to:
- request foreground & background color (like we already do)
- set color with RGB and colons
- request foreground & background color, check if it matches.
- set color with RGB and semicolons
- request foreground & background color, check if it matches.
- set underline color with RGB and semicolons
- request underline color, check if it matches (is this possible?)
It's going to be a bit much perhaps. We could only check if setting RGB
with semicolons work, it appears they work most widely, even though it's
not an official standard.
The underline color is clearing the color in xterm. Not sure what other
terminals support it or if it's possible to read it back.
…--
The question is: What do you do with your life?
The wrong answer is: Become the richest guy in the graveyard.
(billionaire and Oracle founder Larry Ellison)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
Testing for semicolons first, then colons, seems to make sense. Maybe after testing for |
Provisional requirements: Every colorscheme…
A few problems are still pending, though:
In my opinion, a colorscheme that:
is acceptable. |
I'd also vote to not use underline in any form. Current default vim theme does this for highlighting current line. Very annoying. Dimming / highlighting background color looks far better. |
Would this be OK?
|
I think so. Typography should be reserved for something like advanced markdown highlighting |
I do agree that bold and underline should only be used when we need to differentiate ui elements, autocompletion choices and so on, not used as part of syntax highlighting per se. I'd also like to remind everybody that the 18 themes vim ships with aren't going anywhere, and that we probably don't want to add too many new themes to that list, lest they eventually fall into the same state of disrepair as the old ones. I'm definitely in favour of only providing one new light colourscheme and one new dark colourschemes for the 8/16/88c versions, all barebones but functional, and then maybe throwing a couple different ones together for 256c and TC. We can't add too much cruft, we can't pull the cruft from existing themes, and we sure don't want people asking on reddit and stackoverflow why the version of Speaking of which, we really need to get a definitive list of what can be changed by a theme, and what cannot. |
I'm afraid a hard ban on About the 18 default colorschemes, they will be overhauled as part of this project so they won't go anywhere. To be honest, I don't expect to find more than a handful candidates.
We can and we will.
I want to avoid that as much as possible. That's the reason I would prefer to have simple colorschemes that don't require any fiddling. I'm seriously concerned about the eventual impact of this initiative across support channels: I have mild PTSD from the early days of Solarized and I really don't want to reboot that nightmare.
I agree and I've voiced my opinion on that matter earlier. A definitive list of do's and don't's will come soon. As for your last point about links. This is a painful issue that can't be fixed at the colorscheme-level. It must be fixed in Vim. |
@romainl from solarized, what are you thinking about (installation issues, support my fave plugin issues, or something else)? /just wondering also, happy to help here as I can |
@benknoble Solarized is an incredibly brittle and overengineered mess, "sold" entirely on hype and pseudo-science, that hasn't been updated in a decade. It doesn't support truecolour, it's impossible to port to 256c, and it's single-handedly responsible for several % of vim-related posts online. |
I maintain a fork of Solarized that supports true colors, but I agree with you: Solarized has no place in Vim core. |
@benknoble, basically what @neutaaaaan and @lifepillar said: it is an abomination that shouldn't exist. Note that the colors themselves of the Vim colorscheme are not in question, it's how it is built that is wrong and that has caused so many issues in the past. UUrgl, you triggered my PTSD… On a more positive note, a solarized-inspired colorscheme with a palette more compatible with 256c would certainly be acceptable as long as it satisfies our (WIP) requirements. On a more general note, I want the new colorschemes (and the remakes of the old colorschemes) to be functional out-of-the-box in as many environments as possible without exposing options or requiring any action from the user beyond |
I’m not sure how feasible this is, as IMHO much of Solarized’s characteristic ‘look’ comes from the beige/cream coloured background on the light version, and the deep blue used on the dark version. Neither of these colours has a close enough (in my eyes) equivalent in 256c. Maybe it might be a better idea to focus on adapting colourschemes that are ‘friendly’ to 256c, a quality that definitely requires a background very close to grey. In particular, I can vouch for remaking Jellybeans, as its colours seem to work especially well in 256c. I actually prefer the 256c version over the True Colour one! Sorcerer/Apprentice and Tomorrow Night are also good candidates. |
@arzg Solarized is indeed very non-256c-friendly, which has been the cause of much of the nightmare, so I'm not sure either. My comment was meant to convey the idea that choosing colorschemes will not primarily be a matter of taste. Ideally, I would prefer to leave "I like this colorscheme" and "I don't like this colorscheme" outside of the equation. |
Cool, thanks for the heads-up. Is there any place where the choice of colourschemes to be included can be bike-shedded? :) |
Closest color is probably 230, but you can define both guibg and closest ctermbg in themes. Vim automatically enabling termguicolors if terminal supports gui colors would be helpful for sure |
Just for the sake of completeness, https://github.com/jan-warchol/selenized appears to rectify some Solarized issues, while keeping the “solarized” look-and-feel. The discrepancy between terminal and GUI colors is unavoidable, however. As a more general remark: it is possible to quantify the difference between RGB colors and their xterm approximations. Rather than a narrow constraint on the background color, a more general guideline might be defined along these lines: “color schemes where the maximum discrepancy between a GUI color and the correspondent xterm color is greater than N are not acceptable”. This has the advantage of being objective and measurable. It might be even included in |
@arzg jellybeans does a decent amount of rewiring under the hood, we'd run into the issue romainl and I mentionned the other day. So does the version of Tomorrow Night you linked to. People already have expectations about how they're supposed to look that we wouldn't be able to match. Generally speaking, it's a symptom of bad design, but there's also the issue of vim highlighting falling apart when you switch from one of those customized themes to a more standard one. |
I’d agree that this kind of nonstandard linking and highlighting of filetype-specific highlight groups doesn’t belong in a colourscheme that’s meant to be shipped with Vim. What I meant was less that those colourschemes should be copied verbatim, but rather that they could be ‘remastered’ by reusing their palettes and the assignment of the colours from these palettes to standard Vim highlight groups. In fact, a couple of months ago I created a new colourscheme that uses Jellybeans’ 256-colour palette, but excludes the rest of Jellybeans’ complexity. I did the same for Tomorrow Night, but with True Colour instead of 256. I only used them for a few days before switching back to what I was using at the time, so they definitely need some polishing, but they might still be useful. I haven’t released either of them ‘properly’, but I have created a Gist including both of the Colortemplate files. |
@arzg I could see that working for themes that don't do too much sleight of hand. I'm just afraid that Joe Schmoe will expect some behaviour no matter what. |
I've actually spent quite some time to design function that converts rgb color to xterm equivalent and minimizes visual distance. For sure it can be improved but at least it's O(1): N = []
for i, n in enumerate([47, 68, 40, 40, 40, 21]):
N.extend([i]*n)
def rgb_to_xterm(r, g, b):
mx = max(r, g, b)
mn = min(r, g, b)
if (mx-mn)*(mx+mn) <= 6250:
c = 24 - (252 - ((r+g+b) // 3)) // 10
if 0 <= c <= 23:
return 232 + c
return 16 + 36*N[r] + 6*N[g] + N[b] Maybe Vim could even do such conversion for gui colors internally |
Maybe this could be remedied by changing the name entirely from the original, rather than modifying it slightly. This slight modification has led to confusion amongst some font patching projects – at least one person has mistakenly identified ‘Fura Code’ as a typo (the original font is called ‘Fira Code’). |
@arzg sunitized and gummybears :p |
I don't think that it's a good idea, in general. In my experience, when you start approximating colors, there are cases where you want to use an xterm color that is not the most visually similar to its RGB counterpart. So, it is better to let the developer choose the xterm colors. That said, an automatic fallback for when the color scheme does not specify suitable terminal colors might be possible. I might be wrong, but IIRC Neovim does something like that. |
I've worked a bit on that pure monochrome theme that would allow people to ignore a broken environment, and keep Not defining anything but bold/underline/reverse and letting vim use your terminal foreground and background colors works just fine. Any comments ? |
Could you open a dedicated issue or pull request? That way we will be able to discuss this more freely. |
Soo any final guidelines? In my opinion is enough with the following:
|
@Flamekasai no official guidelines yet. I have three weeks of freedom next month, which I will devote to this project. As for your list, it seems to be very close to what we are getting at. |
Oh okey, don't forget to enjoy free time too. I'm really excited for this project and to help when everything is ready to start. |
Colorschemes can be grouped according to several criteria:
We can have several approaches:
The text was updated successfully, but these errors were encountered: