summaryrefslogtreecommitdiff
path: root/.config/wallust/templates
diff options
context:
space:
mode:
Diffstat (limited to '.config/wallust/templates')
-rw-r--r--.config/wallust/templates/vis-theme.lua19
1 files changed, 17 insertions, 2 deletions
diff --git a/.config/wallust/templates/vis-theme.lua b/.config/wallust/templates/vis-theme.lua
index 9fc9900..ef8245c 100644
--- a/.config/wallust/templates/vis-theme.lua
+++ b/.config/wallust/templates/vis-theme.lua
@@ -2,8 +2,23 @@
-- Source of truth: wallust/.config/wallust/templates/vis-theme.lua
local lexers = vis.lexers
+-- Blend two #rrggbb colors; t = weight of b (0..1).
+local function mix(a, b, t)
+ local function parse(c)
+ c = c:gsub('#', '')
+ return tonumber(c:sub(1, 2), 16), tonumber(c:sub(3, 4), 16), tonumber(c:sub(5, 6), 16)
+ end
+ local ar, ag, ab = parse(a)
+ local br, bg_, bb = parse(b)
+ local function ch(x, y)
+ return string.format('%02x', math.floor(x + (y - x) * t + 0.5))
+ end
+ return '#' .. ch(ar, br) .. ch(ag, bg_) .. ch(ab, bb)
+end
+
+
lexers.STYLE_DEFAULT = 'fore:{{foreground}},back:{{background}}'
-lexers.STYLE_NOTHING = ''
+lexers.STYLE_NOTHING = 'back:{{background}}'
lexers.STYLE_CLASS = 'fore:{{color6}}'
lexers.STYLE_COMMENT = 'fore:{{color8}},italics'
lexers.STYLE_CONSTANT = 'fore:{{color13}}'
@@ -24,7 +39,7 @@ lexers.STYLE_WHITESPACE = ''
lexers.STYLE_EMBEDDED = 'fore:{{color13}}'
lexers.STYLE_IDENTIFIER = ''
-lexers.STYLE_LINENUMBER = 'fore:{{color8}}'
+lexers.STYLE_LINENUMBER = 'fore:' .. mix('{{background}}', '{{color8}}', 0.35)
lexers.STYLE_LINENUMBER_CURSOR = 'fore:{{color8}}'
lexers.STYLE_CURSOR = 'back:{{color4}}'
lexers.STYLE_CURSOR_PRIMARY = 'fore:{{background}},back:{{color6}},bold'