Skip to content

Commit

Permalink
fix(day)!: Chose palette for day
Browse files Browse the repository at this point in the history
BREAKING CHANGE: removed day_brightness, as it's not needed anymore
  • Loading branch information
gi1242 committed Feb 6, 2024
1 parent 610179f commit d310fc6
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 17 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ require("tokyonight").setup({
floats = "dark", -- style for floating windows
},
sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]`
day_brightness = 0.3, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors
hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**.
dim_inactive = false, -- dims inactive windows
lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold
Expand Down
1 change: 0 additions & 1 deletion doc/tokyonight.nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ unless `setup` is explicitly called.
floats = "dark", -- style for floating windows
},
sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]`
day_brightness = 0.3, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors
hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**.
dim_inactive = false, -- dims inactive windows
lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold
Expand Down
44 changes: 39 additions & 5 deletions lua/tokyonight/colors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,45 @@ M.night = {
bg = "#1a1b26",
bg_dark = "#16161e",
}
M.day = M.night

M.day = {
none = "NONE",
bg_dark = "#e1e1e9",
bg = "#d9dae5",
bg_highlight = "#bdc2d6",
terminal_black = "#414868",
fg = "#0a143f",
fg_dark = "#293156",
fg_gutter = "#c6cadc",
dark3 = "#545c7e",
comment = "#4f577d",
dark5 = "#5d648c",
blue0 = "#3d59a1",
blue = "#083085",
cyan = "#0071b3",
blue1 = "#1b96ac",
blue2 = "#0a91a8",
blue5 = "#0098d6",
blue6 = "#0c9c9a",
blue7 = "#b1bdd7",
magenta = "#7d3df0",
magenta2 = "#ff007c",
purple = "#6135b1",
orange = "#cc4c00",
yellow = "#ad8200",
green = "#349900",
green1 = "#27956a",
green2 = "#32804d",
teal = "#14947b",
red = "#e20d35",
red1 = "#bf2626",
git = { change = "#6183bb", add = "#449dab", delete = "#914c54" },
gitSigns = {
add = "#266d6a",
change = "#536c9e",
delete = "#b2555b",
},
}

M.moon = function()
local ret = {
Expand Down Expand Up @@ -111,7 +149,6 @@ function M.setup(opts)
local colors = vim.tbl_deep_extend("force", vim.deepcopy(M.default), palette)

util.bg = colors.bg
util.day_brightness = config.options.day_brightness

colors.diff = {
add = util.darken(colors.green2, 0.15),
Expand Down Expand Up @@ -156,9 +193,6 @@ function M.setup(opts)
}

config.options.on_colors(colors)
if opts.transform and config.is_day() then
util.invert_colors(colors)
end

return colors
end
Expand Down
1 change: 0 additions & 1 deletion lua/tokyonight/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ local defaults = {
floats = "dark", -- style for floating windows
},
sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]`
day_brightness = 0.3, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors
hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**.
dim_inactive = false, -- dims inactive windows
lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold
Expand Down
5 changes: 0 additions & 5 deletions lua/tokyonight/theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -872,11 +872,6 @@ function M.setup()

options.on_highlights(theme.highlights, theme.colors)

if config.is_day() then
util.invert_colors(theme.colors)
util.invert_highlights(theme.highlights)
end

return theme
end

Expand Down
4 changes: 0 additions & 4 deletions lua/tokyonight/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ local M = {}

M.bg = "#000000"
M.fg = "#ffffff"
M.day_brightness = 0.3

---@param c string
local function hexToRgb(c)
Expand Down Expand Up @@ -39,9 +38,6 @@ function M.invert_color(color)
if color ~= "NONE" then
local hsl = hsluv.hex_to_hsluv(color)
hsl[3] = 100 - hsl[3]
if hsl[3] < 40 then
hsl[3] = hsl[3] + (100 - hsl[3]) * M.day_brightness
end
return hsluv.hsluv_to_hex(hsl)
end
return color
Expand Down

0 comments on commit d310fc6

Please sign in to comment.