summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-05 04:24:13 -0500
committerJune McEnroe <june@causal.agency>2020-02-05 04:24:13 -0500
commit6e679bdf26fa4dae651aade985155bd424761a3a (patch)
tree92eb50e7ec420e7431144e6e5246a52a5aa5344f
parentSend input as raw IRC in <debug> (diff)
downloadcatgirl-6e679bdf26fa4dae651aade985155bd424761a3a.tar.gz
catgirl-6e679bdf26fa4dae651aade985155bd424761a3a.zip
Modulo colors before comparing pairs
Otherwise a new pair is allocated every time a high color is requested.
-rw-r--r--ui.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui.c b/ui.c
index 12205cc..894e04d 100644
--- a/ui.c
+++ b/ui.c
@@ -135,12 +135,14 @@ static attr_t colorAttr(short fg) {
 
 static short colorPair(short fg, short bg) {
 	if (bg == -1) return 1 + fg;
+	fg %= COLORS;
+	bg %= COLORS;
 	for (short pair = 17; pair < colorPairs; ++pair) {
 		short f, b;
 		pair_content(pair, &f, &b);
 		if (f == fg && b == bg) return pair;
 	}
-	init_pair(colorPairs, fg % COLORS, bg % COLORS);
+	init_pair(colorPairs, fg, bg);
 	return colorPairs++;
 }
 
>Add photos from September 5June McEnroe 2024-09-15Add some more film stocks to the listJune McEnroe 2024-09-13Add photos from September 2June McEnroe 2024-09-13Add Fomapan 200 to films listJune McEnroe 2024-09-10Add August 29 picnic photosJune McEnroe 2024-09-08Apply some bold to trips renderingJune McEnroe 2024-09-08Render trips hopefully more efficientlyJune McEnroe 2024-09-08Allow removing bodies and lensesJune McEnroe 2024-09-08Limit body width so it looks less silly on desktopJune McEnroe 2024-09-07Handle no film being loadedJune McEnroe 2024-09-07Fancy up the text a littleJune McEnroe