feat: configurable brightness of the Day style
This commit is contained in:
@@ -108,7 +108,7 @@ The **day** style will be used if:
|
|||||||
+ or `vim.o.background == "light"`
|
+ or `vim.o.background == "light"`
|
||||||
|
|
||||||
| Option | Default | Description |
|
| Option | Default | Description |
|
||||||
| ----------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|-------------------------------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| tokyonight_style | `"storm"` | The theme comes in three styles, `storm`, a darker variant `night` and `day`. |
|
| tokyonight_style | `"storm"` | The theme comes in three styles, `storm`, a darker variant `night` and `day`. |
|
||||||
| tokyonight_terminal_colors | `true` | Configure the colors used when opening a `:terminal` in Neovim |
|
| tokyonight_terminal_colors | `true` | Configure the colors used when opening a `:terminal` in Neovim |
|
||||||
| tokyonight_italic_comments | `true` | Make comments italic |
|
| tokyonight_italic_comments | `true` | Make comments italic |
|
||||||
@@ -121,6 +121,7 @@ The **day** style will be used if:
|
|||||||
| tokyonight_dark_sidebar | `true` | Sidebar like windows like `NvimTree` get a darker background |
|
| tokyonight_dark_sidebar | `true` | Sidebar like windows like `NvimTree` get a darker background |
|
||||||
| tokyonight_dark_float | `true` | Float windows like the lsp diagnostics windows get a darker background. |
|
| tokyonight_dark_float | `true` | Float windows like the lsp diagnostics windows get a darker background. |
|
||||||
| tokyonight_colors | `{}` | You can override specific color groups to use other groups or a hex color |
|
| tokyonight_colors | `{}` | You can override specific color groups to use other groups or a hex color |
|
||||||
|
| tokyonight_day_brightness | `0.3` | Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors |
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
-- Example config in Lua
|
-- Example config in Lua
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ function M.setup(config)
|
|||||||
colors.bg = "#1a1b26"
|
colors.bg = "#1a1b26"
|
||||||
end
|
end
|
||||||
util.bg = colors.bg
|
util.bg = colors.bg
|
||||||
|
util.day_brightness = config.dayBrightness
|
||||||
|
|
||||||
colors.diff = {
|
colors.diff = {
|
||||||
add = util.darken(colors.green2, 0.15),
|
add = util.darken(colors.green2, 0.15),
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ end
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
style = opt("style", "storm"),
|
style = opt("style", "storm"),
|
||||||
|
dayBrightness = opt("day_brightness", 0.3),
|
||||||
transparent = opt("transparent", false),
|
transparent = opt("transparent", false),
|
||||||
commentStyle = opt("italic_comments", true) and "italic" or "NONE",
|
commentStyle = opt("italic_comments", true) and "italic" or "NONE",
|
||||||
keywordStyle = opt("italic_keywords", true) and "italic" or "NONE",
|
keywordStyle = opt("italic_keywords", true) and "italic" or "NONE",
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ util.colorCache = {}
|
|||||||
|
|
||||||
util.bg = "#000000"
|
util.bg = "#000000"
|
||||||
util.fg = "#ffffff"
|
util.fg = "#ffffff"
|
||||||
|
util.day_brightness = 0.3
|
||||||
|
|
||||||
local function hexToRgb(hex_str)
|
local function hexToRgb(hex_str)
|
||||||
local hex = "[abcdef0-9][abcdef0-9]"
|
local hex = "[abcdef0-9][abcdef0-9]"
|
||||||
@@ -56,7 +57,7 @@ function util.invertColor(color)
|
|||||||
local hsl = hsluv.hex_to_hsluv(color)
|
local hsl = hsluv.hex_to_hsluv(color)
|
||||||
hsl[3] = 100 - hsl[3]
|
hsl[3] = 100 - hsl[3]
|
||||||
if hsl[3] < 40 then
|
if hsl[3] < 40 then
|
||||||
hsl[3] = hsl[3] + (100 - hsl[3]) * 0.3
|
hsl[3] = hsl[3] + (100 - hsl[3]) * util.day_brightness
|
||||||
end
|
end
|
||||||
return hsluv.hsluv_to_hex(hsl)
|
return hsluv.hsluv_to_hex(hsl)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user