akinomyoga / cxxmatrix

C++ Matrix: The Matrix Reloaded in Terminals (Number falls, Banners, Matrix rains, Conway's Game of Life and Mandelbrot set)
MIT License
685 stars 76 forks source link

Colors not working properly. #8

Closed dolour closed 4 years ago

dolour commented 4 years ago

Cant figure out whats wrong, printenv returns TERM=xterm-256color and COLORTERM=truecolor, i still get what looks like 16 color output however(which isnt pretty). Currently running Manjaro, with both gnome-terminal and xterm exhibiting the same behavior.

akinomyoga commented 4 years ago

Thank you for your report! But I cannot reproduce the behavior.

TERM=xterm-256color and COLORTERM=truecolor

cxxmatrix doesn't support the truecolor. It only supports 256 index colors.

16 color output however(which isnt pretty).

Does this mean you see random R/G/B/C/M/Y colors on your terminal? Or do you see only two colors of green and light green? I think it will be helpful if you could paste the screenshot of the terminal.

dolour commented 4 years ago

Its a couple variations of green, alltho most of it is a pretty bad mush.

Allso(quote from archwiki) "Note that the Linux kernel supports the SGR escape sequences for true-color, but it is pointless to use it, because the driver maps the 24-bit color specifications to a 256-colors color map in the kernel."

So that "normally" shouldnt pose an issue, i will try out toying with COLORTERM when i get home. This also occurs on my roommates stock arch machine, so this should be a quite common issue.

akinomyoga commented 4 years ago

Thank you very much for the explanation. Actually cxxmatrix uses ten levels of brightness (nine greens + white) to show characters by default. The appearance should look like the animated GIF in README. (If you expect something like 256 levels of green, cxxmatrix doesn't support it because not all the colors in 256 index color table are green.)

Allso(quote from archwiki) "Note that the Linux kernel supports the SGR escape sequences for true-color, but it is pointless to use it, because the driver maps the 24-bit color specifications to a 256-colors color map in the kernel."

This description explains the behavior of Linux console built in the kernel. When you use the terminal emulators like GNOME Terminal and XTerm, the above description doesn't apply.

i will try out toying with COLORTERM

cxxmatrix doesn't use the COLORTERM so it will never affect the results.

I have a question. Do you run cxxmatrix in some terminal multiplexers like tmux or screen? If there is some miss configuration for the terminal multiplexers, it is possible that colors get strange behavior.

dolour commented 4 years ago

Haha, no ofc i dont expect 256 shades of green. ;) There just seem to be alot less colors than on the GIF from the readme, it kinda looks like its only using one shade of green really: [url=https://www.dropbox.com/s/zif333xftccev37/Screenshot%20from%202020-04-04%2015-57-26.png?dl=0]screenie[/url]

Allso, no im not using any multiplexers, just plain gnome/guake terminal and xterm.

akinomyoga commented 4 years ago

Thank you! I see the problem. OK, actually I recently decreased the brightness of the background, which resulted in less colors for the backgrounds. I will later readjust the calculation of the background colors.

akinomyoga commented 4 years ago

It turned out that the color variation was not really less than before, but there was additional effects caused by the noise in color quantization before. I have adjusted the diffuse color calculations so that the color quantization noise again appears. I think now the color looks like before. I close this issue.

Sorry for the late support and thank you for the report!