diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-12-06 16:53:11 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-12-06 16:53:11 -0800 |
commit | a0c66dbe3112fbd9ff4716fc6c93b82a59c8e7f0 (patch) | |
tree | 9fe16e4f1e6200096b3729ba1a113c43aae66451 /src/lcurses/curses.c | |
parent | 88071687292d9ad3766f3fa05f48777d97725b0c (diff) | |
download | teliva-a0c66dbe3112fbd9ff4716fc6c93b82a59c8e7f0.tar.gz |
more configurable colors
Also start using 256 colors, under the assumption most people will have them.
Diffstat (limited to 'src/lcurses/curses.c')
-rw-r--r-- | src/lcurses/curses.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lcurses/curses.c b/src/lcurses/curses.c index f6b425d..2c53022 100644 --- a/src/lcurses/curses.c +++ b/src/lcurses/curses.c @@ -367,6 +367,22 @@ Puse_default_colors(lua_State *L) /*** +Set -1 foreground and background colors. +@function use_default_colors +@treturn bool `true`, if successful +@see use_default_colors(3x) +@fixme ncurses only? +*/ +static int +Passume_default_colors(lua_State *L) +{ + int fg = checkint(L, 1); + int bg = checkint(L, 2); + return pushokresult(assume_default_colors(fg, bg)); +} + + +/*** Associate a color pair id with a specific foreground and background color. @function init_pair @int pair color pair id to act on @@ -1289,6 +1305,7 @@ static const luaL_Reg curseslib[] = LCURSES_FUNC( Punctrl ), LCURSES_FUNC( Pungetch ), LCURSES_FUNC( Puse_default_colors), + LCURSES_FUNC( Passume_default_colors), {NULL, NULL} }; |