descriptionnone
repository URLhttps://github.com/rofl0r/concol.git
ownerretnyg@gmx.net
last changeSun, 16 Oct 2022 13:09:55 +0000 (16 13:09 +0000)
last refreshWed, 24 Apr 2024 23:42:31 +0000 (25 01:42 +0200)
content tags
add:
README.md

concol - a library for colourful terminal apps

most modern terminal emulators feature plenty of colors, between 64 - 256. the major hindrance to its usage is that the (n)curses library makes it very difficult to use them. it sees colors as colorpairs which have to be set up one after the other, resulting in a ton of code and work to do so.

concol offers a simple API that allows the programmer to just throw an RGB value at it (either for background or foreground color) and use that at once. the tedious colorpair manipulation is all done automatically by the library.

as a bonus, there are 3 different backends:

the SDL backend is perfect for developing the app as it allows to debug the application without interference between the terminal modes used by GDB and the app itself, which is usually a major pain when developing ncurses apps.

the termbox backend otoh is good to make tiny static linked programs when 8 colors are sufficient, since it is much smaller than (n)curses. (note that termbox development diverged a lot from its original goals after commit 66c3f91b. thus it is advised to use the parent of this commit, or use the fork cursebox ( https://github.com/strake/cursebox.c ) (untested). later termbox version weren't tested as well, so they may not work due to changed API.

see the examples directory for usage of this library.

Compilation

make BACKEND=SDL

or

make BACKEND=SDL2

or

make BACKEND=NCURSES

or

make BACKEND=TERMBOX

if you want to build the example programs, do the same, but use the examples target, e.g.

make BACKEND=NCURSES examples

TODO

it might make sense to start using the colors internally from 256 downwards, as this has the advantage that the original 16 terminal colors never get changed when using less than 240 colors (ncurses backend).

shortlog
2022-10-16 rofl0rREADME: mention SDL2 backendmaster
2022-10-16 rofl0rmake examples: also build plasma example
2022-10-16 rofl0rMakefile: link examples against static concol lib
2022-10-16 rofl0rMakefile: make pkg-config overridable
2022-10-16 rofl0rMakefile: use pkg-config to get ncurses, lepton link...
2022-10-16 rofl0rREADME: fix build instructions
2022-10-16 rofl0rfix build with latest glibc (stropts.h -> strings.h)
2021-04-17 rofl0radd console_sel.h for backend selection, removes circul...
2021-04-16 rofl0rconsole_chars: fix GCC 10 regression
2021-01-10 rofl0radd cash register example app
2021-01-10 rofl0rinitial SDL2 support
2020-11-13 rofl0rsdlconsole putchar: don't draw when cursor is outside...
2019-10-10 rofl0rsdlconsole: make msleep() static for namespace cleanness
2019-04-08 rofl0radd support for RcB2 build sys (remove RcB)
2018-01-14 rofl0radd possibility to disable colors completely
2018-01-14 rofl0rsdlconsole: add a cache
...
heads
18 months ago master