tokyonight: Add onColor and onHightlights (#309)

Co-authored-by: Carl Dong <git@carldong.me>
This commit is contained in:
Gaétan Lepage 2023-03-31 23:12:48 +02:00 committed by GitHub
parent 75f7b22f21
commit d62edf4178
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 4 deletions

View file

@ -50,6 +50,21 @@ in {
lualineBold =
helpers.defaultNullOpts.mkBool false
"When true, section headers in the lualine theme will be bold";
onColors =
helpers.defaultNullOpts.mkStr "function(colors) end"
''
Override specific color groups to use other groups or a hex color.
function will be called with a ColorScheme table.
`@param colors ColorScheme`
'';
onHighlights =
helpers.defaultNullOpts.mkStr "function(highlights, colors) end"
''
Override specific highlights to use other groups or a hex color.
function will be called with a Highlights and ColorScheme table
`@param highlights Highlights`
`@param colors ColorScheme`
'';
};
};
config = mkIf cfg.enable {
@ -64,6 +79,12 @@ in {
dim_inactive = dimInactive;
lualine_bold = lualineBold;
day_brightness = dayBrightness;
on_colors =
helpers.ifNonNull' cfg.onColors
(helpers.mkRaw onColors);
on_highlights =
helpers.ifNonNull' cfg.onHighlights
(helpers.mkRaw onHighlights);
};
in ''
require("tokyonight").setup(${helpers.toLuaObject setupOptions})

View file

@ -27,10 +27,8 @@
hideInactiveStatusline = false;
dimInactive = false;
lualineBold = false;
# Not implemented
# onColors = {__raw = "function(colors) end";};
# Not implemented
# onHighlights = {__raw = "function(colors) end";};
onColors = "function(colors) end";
onHighlights = "function(highlights, colors) end";
};
};
}