ph1l / stars

starfield in C with frontends in SDL, X11, and ncurses
GNU General Public License v3.0
8 stars 0 forks source link

Command-line options for 256 color for opacity in nstars #2

Closed livibetter closed 7 years ago

livibetter commented 7 years ago

I noticed that ncurses is only one does not utilize the opacity, my guess is about the standard 16-color.

Can we add option parsing and allow to turn on 256 color support? IIRC, it has 24 gray gradient. I also prefer the "." (period) over "*" (asterisk), it looks more consistent with other frontends, so with options, user can override the character (may also want to work to support Unicode).

I can help with this, but maybe you would prefer to implement by yourself if you think this is a good feature. It might also be a good idea to add options support to the other two, even without any options.

ph1l commented 7 years ago

I appreciate the interest in the project!

For me, the ncurses front end was mostly a study in basic ncurses and the silly IRC-like command interface at the bottom. I don't actually mind what character represents a star. My choice of asterisk was more due to it appearing closer to the center of the line than the period.

Pull requests are appreciated :-)

Either way, feel free to submit a PR changing the character. Maybe if you're up to it, you could also add a /char x command to be able to change it as the program is running too! shouldn't be that hard.

I did not attempt to experiment with color here, but applying the opacity would be cool too.

vcaputo commented 7 years ago

It would be interesting to vary the character to the closest approximate to the star's sub-character position. This is the kind of thing aalib/libcaca does to render graphics in text, but I think stars may be a nicely simplified case where it wouldn't require much effort to get reasonable results.

livibetter commented 7 years ago

@ph1l how silly me to forget there is the "silly IRC-like command interface" already in place. I was wondering why there is a command-line interface when there is only one command you can issue. Now it's very helpful. I will try to add two commands first, /char X and /colormode <mono|256>.

@vcaputo I think I need PR to see what you are talking about.

vcaputo commented 7 years ago

@livibetter Perhaps the aalib gallery will suffice http://aa-project.sourceforge.net/gallery/

livibetter commented 7 years ago

Closing, this will be resolved in #6.