about summary refs log tree commit diff stats
path: root/src/lcurses
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-12-06 16:53:11 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-12-06 16:53:11 -0800
commita0c66dbe3112fbd9ff4716fc6c93b82a59c8e7f0 (patch)
tree9fe16e4f1e6200096b3729ba1a113c43aae66451 /src/lcurses
parent88071687292d9ad3766f3fa05f48777d97725b0c (diff)
downloadteliva-a0c66dbe3112fbd9ff4716fc6c93b82a59c8e7f0.tar.gz
more configurable colors
Also start using 256 colors, under the assumption most people will have
them.
Diffstat (limited to 'src/lcurses')
-rw-r--r--src/lcurses/curses.c17
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}
 };