TerminalView
TerminalView copied to clipboard
Colors
This isn't done yet as it has some bugs. Pretty pictures:
Derived from "Mariana" scheme

Derived from "Blue Thunder" scheme

Derived from "Breakers" scheme

I've been fudging with getting the foreground and background colors switched because as you can see, for some reason it selects the background while it should select the foreground.
There is a bug/feature of add_regions
: if the background of a scope is exactly the same as the background of the theme. The foregound and background colors would be inverted.
I can still remember how long it took me to identify this issue. Also check https://github.com/SublimeTextIssues/Core/issues/817
That's why the theme background is #000000
while the scope backgrounds are #000001
Thanks, I never would have guessed the problem was there. add_regions
foils my plans yet again ;)

Things are starting to look okay now. I'll have to think of another way to represent terminalview.black_black
though.
Starts to work pretty good now:



One problem I have is that there's supposed to be a ninth color called "default", but pyte doesn't seem to care about that:


What is the expected result for the default color? Isn't it showing white color now?
How do think the idea of generating settings like
'terminal_color_0' : '#000000',
'terminal_color_1' : '#ff8787',
'terminal_color_2' : '#87d75f',
'terminal_color_3' : '#ffd75f',
'terminal_color_4' : '#87afff',
'terminal_color_5' : '#af87ff',
'terminal_color_6' : '#d7ff87',
'terminal_color_7' : '#bfbfbf',
'terminal_color_8' : '#000000',
'terminal_color_9' : '#ff8787',
'terminal_color_10' : '#87d75f',
'terminal_color_11' : '#ffd75f',
'terminal_color_12' : '#87afff',
'terminal_color_13' : '#af87ff',
'terminal_color_14' : '#d7ff87',
'terminal_color_15' : '#bfbfbf',
and applying them to TerminalView in run_time? It will give much more controls to users.
I think that's okay, but I worry for the startup time. Would that be noticeable?
If we only do it once until Sublime Text restarts, it should okay.
Very interesting - while personally I like the black/white scheme it is definitely nice that it can adapt to user color scheme. I'll just wait a bit with pulling this until we have 0.5 out then we can look into including this for 0.6 :+1:
Yeah, I'm aiming for 0.6 for this PR.
A few notes after testing this:
I ran into a bit of trouble since I don't have any dark blue color in my color scheme (I think). My light blue was used for cyan and magenta was used for blue (thus magenta was not visible):
I still like this approach but I'm worried about it giving users an inconsistent experience. Maybe TerminalView should ship with a default color scheme similar to what we have now + a few alternatives that can be selected through settings (like maybe a light version with white background). Among the alternatives this could be one of them - a sort of auto color scheme.
Another concern I have if we were to use this as default color scheme is that it doesn't set TerminalView apart from the rest of ST3. I think it's a good thing to have a somewhat different color scheme (atleast as default) since it signals to the user that they are not in a regular ST3 view (different keybindings etc.).
What do you think ?
I'm okay with this being an optional setting in the settings. Preferences differ from person to person and I like my terminal to look like any other view.
For the magenta being black, I think the function extracted only 5 colors and added a black color to get six (see here). Furthermore it then assigned "magenta-ish" to the blue reference color because blue just so happens to come before magenta. The magenta-ish color should have been assigned to the magenta reference. I think that's a bad idea now and I'd like to change the algorithm so that it can better handle schemes with few colors.
Can you put your color scheme in a gist so I can experiment with it?
Color scheme: https://gist.github.com/Wramberg/4c3701579a5c18b581f3f1df4fb521b1 Keep up the nice work - this is quite a cool feature :-)
Just to give an update: cie2000 works now, but it gives basically the same results as cie1994.
Also, your color scheme has 11 colors, so the problem is not that it has too few colors. The problem is actually that while it looks like the magenta color is black, it's actually fairly close (a distance of about 30 units, 15 units is "very close"). The problem is that it is also happens to be very close to the background color. My idea is to check the distance to the background color, and if it's "too close" to the background, change the lightness somehow to account for that. For this, I need to be able to convert from L*a*b*
back to RGB
, so I'll have to implement those conversion functions.
Thank you for the feature. It wouldn't hurt to write in readme that you need to restart sublime in order for the changes to take place. I finally read it from this pull request after almost giving up :P
Hi @johanson, glad you like it. I never got around to finishing this, because it needs a few things still:
- It should be optional.
- Probably should use the newly introduced
.sublime-color-sheme
format instead of the old.tmTheme
format. - Explain in the README how to get this working!
Like @Wramberg I'm occupied with work these days, I'll see if I can find the time to pick this up some day again.