rpg-cli icon indicating copy to clipboard operation
rpg-cli copied to clipboard

Colors for light background

Open mowgli opened this issue 2 years ago • 5 comments

I usually have a light background which makes white color not visible.

For now I patched that in the source but it would be nice to make colors aware of light or dark background or/and configure colors with config files.

It might also be nice to get environment CLICOLOR_FORCE documented if using pipes…

mowgli avatar Apr 09 '22 11:04 mowgli

Thanks, can you point me to what part of the output was difficult to see in light background? Or show me what you patched?

facundoolano avatar Apr 09 '22 13:04 facundoolano

From b11b5e261309c06a161a5754ec768c4277635697 Mon Sep 17 00:00:00 2001
From: Klaus Ethgen <[email protected]>
Date: Sat, 9 Apr 2022 11:54:20 +0100
Subject: [PATCH] Use light background

---
 src/log.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/log.rs b/src/log.rs
index dd6b368..e90837c 100644
--- a/src/log.rs
+++ b/src/log.rs
@@ -423,7 +423,7 @@ fn format_hp_change(receiver: &Character, amount: i32, suffix: &str) -> String {
                 "green"
             }
         } else {
-            "white"
+            "black"
         };
         format!("{:+}hp {}", amount, suffix)
             .color(color)
-- 
2.35.1

mowgli avatar Apr 09 '22 13:04 mowgli

Ok, if that's the only one there's probably a "default" color I can use instead of hardcoding to black or white.

facundoolano avatar Apr 09 '22 13:04 facundoolano

Its the only one I found.

mowgli avatar Apr 09 '22 14:04 mowgli

I just battled a spider, and the yellow text was unreadable on my white background. I hope this file upload works.

2022-06-14_12-34

hymie0 avatar Jun 14 '22 16:06 hymie0