roboticslab-uc3m / color-debug

Colorful command line output C/C++ macros, very flexible!
http://robots.uc3m.es/gitbook-developer-manual/appendix/repository-index.html
GNU Lesser General Public License v2.1
6 stars 1 forks source link

Allow users to customize color output (foreground+background!!) #21

Open jgvictores opened 5 years ago

jgvictores commented 5 years ago

Allow users to customize color output.

Why? At #20 @PeterBowman mentioned Allow users to disable color output because certain colors are not as nicely rendered as on (...) and even hard to read.

Where? Some options:

  1. CMake parameter?
  2. Via .colordebugrc file? Nice idea, but ouch! we need code (aka more stuff in .c).
  3. EDIT: (difficult-to-implement) CMake that parses .colordebugrc file

How? Here are some links, best first:

The last two are plain documentation, we'd have to go to the source.

jgvictores commented 5 years ago

PS: If we ever do this, for #19 via ansicon it should also be supported per https://github.com/adoxa/ansicon/blob/eccbbe7a547f0ff8a3e7e6b6b3eaaa3d7563ae4d/ANSI.c#L331-L369

jgvictores commented 5 years ago

PS: Related to #5 (Windows 10 color console), the blog entry mentioned in the description also has an SGR section: https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#example-of-sgr-terminal-sequences

jgvictores commented 5 years ago

While https://github.com/ikalnytskyi/termcolor is implemented as c++ stream manipulators, other projects in other languages present diffent APIs: chalk, colors.

PeterBowman commented 5 years ago

At #20 @PeterBowman mentioned Allow users to disable color output because certain colors are not as nicely rendered as on (...) and even hard to read.

Not really related to this issue, but related to that comment of mine: I just noticed that white colors (CD_INFO) are not really white since https://github.com/roboticslab-uc3m/color-debug/pull/15, they look rather grayish. This is easier to spot when having both CD output and YARP log messages.