conemu-inside icon indicating copy to clipboard operation
conemu-inside copied to clipboard

Color Theme Selection in ConEmu.WinForms

Open hypersw opened this issue 9 years ago • 13 comments

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 avatar Apr 18 '16 22:04 hypersw

@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?

hypersw avatar Apr 18 '16 22:04 hypersw

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

Maximus5 avatar Apr 18 '16 22:04 Maximus5

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.

hypersw avatar Apr 19 '16 17:04 hypersw

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

Maximus5 avatar Apr 19 '16 18:04 Maximus5

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.

hypersw avatar Apr 19 '16 18:04 hypersw

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 avatar Apr 19 '16 19:04 Maximus5

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

Maximus5 avatar Apr 19 '16 20:04 Maximus5

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

hypersw avatar Apr 19 '16 20:04 hypersw

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

Maximus5 avatar Apr 19 '16 21:04 Maximus5

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

hypersw avatar Apr 19 '16 21:04 hypersw

https://en.m.wikipedia.org/wiki/DirectWrite

Maximus5 avatar Apr 19 '16 21:04 Maximus5

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.

hypersw avatar Apr 19 '16 21:04 hypersw

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

Maximus5 avatar Apr 19 '16 21:04 Maximus5