Maximus5 / conemu-inside

An example, how to embed http://conemu.github.io/ into another graphical application
57 stars 46 forks source link

Color Theme Selection in ConEmu.WinForms #17

Open hypersw opened 8 years ago

hypersw commented 8 years ago

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

hypersw commented 8 years ago

@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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

hypersw commented 8 years ago

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

Maximus5 commented 8 years ago

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

hypersw commented 8 years ago

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

Maximus5 commented 8 years ago

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

hypersw commented 8 years ago

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 commented 8 years ago

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