Skip to content
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

Color Theme Selection in ConEmu.WinForms #17

Open
hypersw opened this issue Apr 18, 2016 · 13 comments
Open

Color Theme Selection in ConEmu.WinForms #17

hypersw opened this issue Apr 18, 2016 · 13 comments

Comments

@hypersw
Copy link
Collaborator

hypersw commented Apr 18, 2016

User should be able to select between themes.
At least these should be supported IMHO:

  • ConEmu default (solarized?)
  • System default (might be needed if you want it to look exactly as other consoles, e.g. for running CUIs).
  • Light background version (for matching the app UI, to prevent the black terminal window standing out brightly — would fit not-heavily-colored utilities, but with CUIs probably the colors would be very surprising).
@hypersw
Copy link
Collaborator Author

hypersw commented Apr 18, 2016

@Maximus5: what's the best way to apply a theme programmatically? Writing Registry values into the ConEmu.xml settings file generally works, is it the best way?

Looks like the themes are only hardcoded in the Options.cpp file and not available to be referenced as a whole in settings, is this right?

How to I color the console frame and the status bar into the light theme — I can set char colors with ColorTableNN, but there's a black frame around them, what is the full list of entries to correct?

@Maximus5
Copy link
Owner

Why do you try to change ColorTableNN? There are palettes, and you may choose them, for example, with -new_console:P:"<Default Windows scheme>".

As for light background. Are you talking about this?

2016-04-19_01-19-48

@hypersw
Copy link
Collaborator Author

hypersw commented Apr 19, 2016

So this is the default scheme with only the fore and back colors swapped?
What would happen of light yellow in this case? E.g. calling msbuild would emit errors in light red and warnings in light yellow, which gets unreadable if only background is changed to light.
Making a scheme by merely inverting the colors has this problem as well. I experimented a bit with choosing colors, but that's incomplete yet. Luckily, there're only 16 of them.

If the scheme is newly-made and not listed in the Options.cpp, is it possible to choose it on the command line (say, if it's written into the settings xml file, which is also specified on the command line)? That's why I started experimenting with ColorTableNN, in the first place.

@Maximus5
Copy link
Owner

Making a scheme by merely inverting the colors has this problem as well.

There is no good solution with schemes. Sure. A lot of console applications looks good with one palette, but awful with another. Example: zsh with <ConEmu> palette.

I have plans to implement "dynamic palettes". ConEmu would change lightness of text, if color distance between fg and bg is too short.
The main problem - RGB to Lab colorspace conversion. Haven't found good samples yet.

is it possible to choose it on the command line

-palette

@hypersw
Copy link
Collaborator Author

hypersw commented Apr 19, 2016

I've implemented the first contraster with HLS, then a colleague upgraded it to use LAB. That stuff has been used in R# for many years right for this goal.
In this case I'm not even sure if it has to be dynamic, there're only 256 possible colors involved.
Actually, HLS is trivial and it might be a good start.

As for the light palette, I've already played with LAB (borrowed the code from R# to make a quick test). The problem is that our LABer is shifting hues when you're trying to get an impossible color, like high-contrast blue on black — blue is simply not light enough for a good contrast, so it shifts towards pinks a bit.

@Maximus5
Copy link
Owner

By "dynamic" I mean "automatic shift of lightness". Sure, it would be done on 256 color table (16fg * 16bg). This "internal palette" is used in virtual console.

@Maximus5
Copy link
Owner

And I would not shift lightness a lot - "dark blue" wouldn't be lighter than "light blue"

@hypersw
Copy link
Collaborator Author

hypersw commented Apr 19, 2016

This already poses a problem because the same color won't be the same over different backgrounds.

@Maximus5
Copy link
Owner

Doesn't matter. The idea - make text readable - is worth.
For example, cleartype technique, especially in DirectWrite, changes lightness of text.

@hypersw
Copy link
Collaborator Author

hypersw commented Apr 19, 2016

DirectWrite, whose stuff is that? Is it used by GDI+ engine, or MIL engine, or Winword?

@Maximus5
Copy link
Owner

@hypersw
Copy link
Collaborator Author

hypersw commented Apr 19, 2016

Looked at that of course, but it's a bit speculative, does not even explain its grid fitting strategies. And hints that XPS won't render thru MIL, that's an interesting point. Never mind, anyway.

@Maximus5
Copy link
Owner

There is a request on the ConEmu issue tracker to support DirectWrite. There you may find comparison screenshots...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants