@@ -59,39 +59,46 @@ themeNames :: [String]
5959themeNames = map fst themesList
6060
6161(&) = withStyle
62- active = fg brightWhite & bold
63- selectbg = yellow
64- select = black `on` selectbg
62+
63+ -- colors from the 8-bit (ish) 240-colour palette (see
64+ -- <https://rich.readthedocs.io/en/stable/appendix/colors.html>, subtract
65+ -- 16 to correct the offset from the 4-bit color palette). These colors
66+ -- should appear the same in all supported terminals.
67+ white8 = Color240 (253 - 16 )
68+ black8 = Color240 (232 - 16 )
69+ red8 = Color240 (124 - 16 )
70+ yellow8 = Color240 (178 - 16 )
71+ blue8 = Color240 (25 - 16 )
72+ active8 = fg (Color240 (255 - 16 )) & bold
73+ -- we use reverseVideo here to have a legible fallback if the terminal does
74+ -- not support the colors (and falls back to black/white)
75+ select8 = yellow8 `on` black8 & reverseVideo
76+ selectNeg = yellow8 `on` red8 & reverseVideo -- & bold
6577
6678themesList :: [(String , AttrMap )]
6779themesList = [
68- (" default" , attrMap (black `on` white) [
69- (attrName " border" , white `on` black & dim)
70- ,(attrName " border" <> attrName " bold" , currentAttr & bold)
71- ,(attrName " border" <> attrName " depth" , active)
72- ,(attrName " border" <> attrName " filename" , currentAttr)
73- ,(attrName " border" <> attrName " key" , active)
74- ,(attrName " border" <> attrName " minibuffer" , white `on` black & bold)
75- ,(attrName " border" <> attrName " query" , active)
76- ,(attrName " border" <> attrName " selected" , active)
77- ,(attrName " error" , fg red)
78- ,(attrName " help" , white `on` black & dim)
79- ,(attrName " help" <> attrName " heading" , fg yellow)
80- ,(attrName " help" <> attrName " key" , active)
81- -- ,(attrName "list" , black `on` white)
82- -- ,(attrName "list" <> attrName "amount" , currentAttr)
83- ,(attrName " list" <> attrName " amount" <> attrName " decrease" , fg red)
84- -- ,(attrName "list" <> attrName "amount" <> attrName "increase" , fg green)
85- ,(attrName " list" <> attrName " amount" <> attrName " decrease" <> attrName " selected" , red `on` selectbg & bold)
86- -- ,(attrName "list" <> attrName "amount" <> attrName "increase" <> attrName "selected" , green `on` selectbg & bold)
87- ,(attrName " list" <> attrName " balance" , currentAttr & bold)
88- ,(attrName " list" <> attrName " balance" <> attrName " negative" , fg red)
89- ,(attrName " list" <> attrName " balance" <> attrName " positive" , fg black)
90- ,(attrName " list" <> attrName " balance" <> attrName " negative" <> attrName " selected" , red `on` selectbg & bold)
91- ,(attrName " list" <> attrName " balance" <> attrName " positive" <> attrName " selected" , select & bold)
92- ,(attrName " list" <> attrName " selected" , select)
93- -- ,(attrName "list" <> attrName "accounts" , white `on` brightGreen)
94- -- ,(attrName "list" <> attrName "selected" , black `on` brightYellow)
80+ -- the default theme, "light", defined in terms of the 240-color palette
81+ (" default" , attrMap (black8 `on` white8) [
82+ (attrName " border" , white8 `on` black8 & dim)
83+ , (attrName " border" <> attrName " bold" , currentAttr & bold)
84+ , (attrName " border" <> attrName " depth" , active8)
85+ , (attrName " border" <> attrName " filename" , currentAttr)
86+ , (attrName " border" <> attrName " key" , active8)
87+ , (attrName " border" <> attrName " minibuffer" , white8 `on` black8 & bold)
88+ , (attrName " border" <> attrName " query" , active8)
89+ , (attrName " border" <> attrName " selected" , active8)
90+ , (attrName " error" , fg red8)
91+ , (attrName " help" , white8 `on` black8 & dim)
92+ , (attrName " help" <> attrName " heading" , fg yellow8)
93+ , (attrName " help" <> attrName " key" , active8)
94+ , (attrName " list" <> attrName " amount" <> attrName " decrease" , fg red8)
95+ , (attrName " list" <> attrName " amount" <> attrName " decrease" <> attrName " selected" , selectNeg)
96+ , (attrName " list" <> attrName " balance" , currentAttr & bold)
97+ , (attrName " list" <> attrName " balance" <> attrName " negative" , fg red8)
98+ , (attrName " list" <> attrName " balance" <> attrName " positive" , fg black8)
99+ , (attrName " list" <> attrName " balance" <> attrName " negative" <> attrName " selected" , selectNeg)
100+ , (attrName " list" <> attrName " balance" <> attrName " positive" <> attrName " selected" , select8)
101+ , (attrName " list" <> attrName " selected" , select8)
95102 ])
96103
97104 ,(" greenterm" , attrMap (green `on` black) [
0 commit comments