fairyglade / ly

display manager with console UI
Do What The F*ck You Want To Public License
5.46k stars 305 forks source link

Change DOOM Fire color #239

Open salteax opened 4 years ago

salteax commented 4 years ago

Is there a way to change the color scheme of the DOOM fire?

schijtreiger commented 4 years ago

Read: https://fabiensanglard.net/doom_fire_psx/index.html && Read: https://github.com/fabiensanglard/DoomFirePSX/blob/master/flames.html

Browse thru the source code, you'll likely find somewhere that "rgbs" are set. Once familiar with the colors, edit the file located at src/draw.c & go to line 512 and see how the colors are set below line from line 516. (example here: https://github.com/nullgemm/ly/blob/77f6958241646e3f315f27bc38212c3c4e1e7a8d/src/draw.c#L512)

The colors say what they are...

salteax commented 4 years ago

Read: https://fabiensanglard.net/doom_fire_psx/index.html && Read: https://github.com/fabiensanglard/DoomFirePSX/blob/master/flames.html

Browse thru the source code, you'll likely find somewhere that "rgbs" are set. Once familiar with the colors, edit the file located at src/draw.c & go to line 512 and see how the colors are set below line from line 516. (example here:

https://github.com/nullgemm/ly/blob/77f6958241646e3f315f27bc38212c3c4e1e7a8d/src/draw.c#L512 )

The colors say what they are...

but where exactly do i find the file where i can edit those things?

FoxyHawk commented 4 years ago

The structure fire is the table which contains the colors and characters used to draw the fire. Each element/line is composed of a character code (in hexadecimal, see the following table), a foreground and a background color.

hex utf-8
2591
2592
2593
2588

It is not clear to me which color standard the colors IDs are following (does not seem to be the 256-colors list) but here is an example with (3, 1) instead of red, (6, 5) yellow and (8 ,7) white:

image

On a more practical side, you have to modify the source code to change the color => compile and reinstall for each color test. Note that make install also reset the config.ini file so do not forget to backup :)

salteax commented 4 years ago

The structure fire is the table which contains the colors and characters used to draw the fire. Each element/line is composed of a character code (in hexadecimal, see the following table), a foreground and a background color. hex utf-8 2591 ░ 2592 ▒ 2593 ▓ 2588 █

It is not clear to me which color standard the colors IDs are following (does not seem to be the 256-colors list) but here is an example with (3, 1) instead of red, (6, 5) yellow and (8 ,7) white:

image

On a more practical side, you have to modify the source code to change the color => compile and reinstall for each color test. Note that make install also reset the config.ini file so do not forget to backup :)

Ok thanks.

I'm curious, can i change those settings when already installed or do i have to get this rep and edit the files there or can i edit it while having ly installed?

miker commented 3 years ago

I know this is nearly 6 months old but for future traveler's sakes; no you can't edit the source and see the change in your currently installed Ly. You have to edit the source, recompile, then reinstall to see what your changes did. Then repeat that process until you get your desired colors Maybe this could turn into a feature request to make DOOM Fire colors configurable via the config?

yobleck commented 3 years ago

color values are explained here: https://github.com/nullgemm/termbox_next/blob/d961a8122210010e7c2c8f201e61170c13d319b4/src/termbox.h#L106

// Colors (see struct tb_cell's fg and bg fields).
#define TB_DEFAULT 0x00
#define TB_BLACK   0x01
#define TB_RED     0x02
#define TB_GREEN   0x03
#define TB_YELLOW  0x04
#define TB_BLUE    0x05
#define TB_MAGENTA 0x06
#define TB_CYAN    0x07
#define TB_WHITE   0x08

This is also relevant for the text color in the config, but there it has to be formatted in dec. (2 for red not 0x02)