-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(palette)!: rework dayfox #285
Conversation
The old dayfox had little contrast for the colors compared to the background. Dayfox has been completely reworked to address this issue. Some notes about design: - Background blended with yellow to make it not as white on the eyes - Foreground is blended with magenta to contrast the yellow in the bg
The new colors do look better, but the change to the hue of background makes the new one very different from the old one. Not sure if other users would consider they're still "the same theme". |
I was never really happy with dayfox and it was the first light theme that I made. I am much happier with the new rework. As nightfox is very customizable if others want to remove the slight hue then can change As for the orange vs yellow comment, I was referring to taking an orange and yellow color and making it pass WCAG AA becomes the same color. |
Changed orange from scratch filelocal S = require("nightfox.lib.shade")
local C = require("nightfox.lib.color")
local fb = C("#282828")
local bb = C("#fafafa")
local k = C("#352c24")
local r = C("#a5222f")
local g = C("#396847")
local y = C("#AC5402")
local b = C("#2848a9")
local m = C("#6e33ce")
local c = C("#287980")
local w = C("#f2e9e1")
local o = C("#955f61") -- #7e4725 #955f61 #7f5539
local p = C("#a440b5")
local bg1 = bb:blend(y, 0.05)
local bg2 = bg1:brighten(-6):blend(m, 0.1)
local bg3 = bg1:brighten(-12):blend(y, 0.1)
local bg4 = bg1:brighten(-24):blend(c, 0.1)
local bg0 = bg1:brighten(-6):blend(y, 0.05)
local fg1 = fb:blend(m, 0.3)
local fg2 = fg1:brighten(12):blend(y, 0.2)
local fg3 = fg1:brighten(24):blend(y, 0.4)
local fg0 = fg1:brighten(-6):blend(b, 0.2)
local sel0 = bg1:blend(y, 0.2)
local sel1 = bg1:blend(c, 0.4)
local comment = bg1:blend(fg1, 0.75):saturate(-100):blend(y, 0.1)
local dayfox = {
bg0 = bg0,
bg1 = bg1,
bg2 = bg2,
bg3 = bg3,
bg4 = bg4,
fg0 = fg0,
fg1 = fg1,
fg2 = fg2,
fg3 = fg3,
sel0 = sel0,
sel1 = sel1,
comment = comment,
}
---------------------------------------------------------------------------
for k, v in pairs(dayfox) do
dayfox[k] = v:to_css()
end
local current_win = vim.api.nvim_get_current_win()
local display = _G.nightfox_display
if not display then
vim.cmd("30vnew \\[nightfox\\]")
display = {
win = vim.api.nvim_get_current_win(),
buf = vim.api.nvim_get_current_buf(),
}
_G.nightfox_display = display
end
local contents = vim.inspect(dayfox)
vim.api.nvim_buf_set_lines(display.buf, 1, -1, 0, vim.split(contents, "\n", true))
vim.api.nvim_set_current_win(current_win)
require("nightfox").setup({
palettes = { dayfox = dayfox },
groups = { dayfox = { ["@field"] = { fg = "fg1" } } },
}) |
For those that want to use the old dayfox you can use nightfox's customization to bring it back: local S = require("nightfox.lib.shade")
require("nightfox").setup({
palettes = {
dayfox = {
black = S.new("#1d344f", "#24476f", "#1c2f44", true),
red = S.new("#b95d76", "#c76882", "#ac5169", true),
green = S.new("#618774", "#629f81", "#597668", true),
yellow = S.new("#ba793e", "#ca884a", "#a36f3e", true),
blue = S.new("#4d688e", "#4e75aa", "#485e7d", true),
magenta = S.new("#8e6f98", "#9f75ac", "#806589", true),
cyan = S.new("#6ca7bd", "#74b2c9", "#5a99b0", true),
white = S.new("#cdd1d5", "#cfd6dd", "#b6bcc2", true),
orange = S.new("#e3786c", "#e8857a", "#d76558", true),
pink = S.new("#d685af", "#de8db7", "#c9709e", true),
comment = "#7f848e",
bg0 = "#dbdbdb", -- Dark bg (status line and float)
bg1 = "#eaeaea", -- Default bg
bg2 = "#dbcece", -- Lighter bg (colorcolm folds)
bg3 = "#ced6db", -- Lighter bg (cursor line)
bg4 = "#bebebe", -- Conceal, border fg
fg0 = "#182a40", -- Lighter fg
fg1 = "#1d344f", -- Default fg
fg2 = "#233f5e", -- Darker fg (status line)
fg3 = "#2e537d", -- Darker fg (line numbers, fold colums)
sel0 = "#e7d2be", -- Popup bg, visual selection bg
sel1 = "#a4c1c2", -- Popup sel bg, search bg
}
}
}) |
The old dayfox had little contrast for the colors compared to the
background. Dayfox has been completely reworked to address this issue.
Some notes about design:
New
Old
Resolves: #282
scratch file used to make palette