nvim-config

Log | Files | Refs | Submodules | README

commit 5d33305670670d10bb975a3589b86fc5ef527dca
parent f3a9a08e87deb1c96d1e2888ec0c405ddfcefd31
Author: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
Date:   Thu, 15 Jun 2023 05:53:21 +0200

feat: new oak theme !

Diffstat:
Acolors/oakv2.lua | 106+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/oakgen.lua | 107+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 213 insertions(+), 0 deletions(-)

diff --git a/colors/oakv2.lua b/colors/oakv2.lua @@ -0,0 +1,106 @@ +local self = MiniColors.as_colorscheme {} + +local base = MiniColors.convert('#E27950', 'oklch') + +local function colorn(t, clip) + return MiniColors.convert({ + l = t.l or 70, + h = t.h or t.n * (360 / 7) + base.h, + c = t.c or base.c + }, 'hex', { gamut_clip = clip or 'chroma' }) +end + +local new_bg = colorn { n = 0, l = 3.5 } +local new_fg = colorn { n = 0, l = 98 } + +local palette = { + bg = new_bg, + dark = colorn { n = 0, l = 20, c = 5 }, + light = colorn { n = 0, l = 50, c = 5 }, + fg = new_fg, + green = colorn { n = 2 }, + blue = colorn { n = 4 }, + orange = colorn { n = 0 }, + yellow = colorn({ n = 1, l = 80 }, 'lightness'), + red = colorn { h = 30, c = 24, l = 63 }, + + kwcold = colorn { n = 5, c = 11 }, + funchot = colorn { n = 0 }, + string = colorn({ n = 3 }, 'lightness'), + type = colorn { n = 2 }, +} + +self.groups.Normal = { fg = palette.fg, bg = palette.bg } +self.groups.Identifier = { link = 'Normal' } + +self.groups.Search = { bg = palette.orange, fg = palette.bg } + +self.groups.MatchParen = { bg = palette.dark } +self.groups.Visual = { bg = palette.dark } +self.groups.LineNr = { fg = palette.light } +self.groups.CursorLineNr = { bg = palette.dark } +self.groups.StatusLine = { bg = palette.dark, bold = true, fg = palette.fg } +self.groups.StatusLineNC = { bg = palette.dark, fg = palette.fg } +self.groups.WinSeparator = { fg = palette.dark } +self.groups.Pmenu = { bg = palette.dark } +self.groups.PmenuSel = { bg = palette.light } +self.groups.ColorColumn = { bg = palette.bg } +self.groups.CursorColumn = { bg = palette.dark } +self.groups.CursorLine = { bg = palette.dark } + +self.groups.NonText = { fg = palette.dark } + +self.groups.Comment = { fg = palette.light, italic = true } +self.groups.Special = { fg = palette.fg } +self.groups["@namespace"] = { fg = palette.type } + +self.groups.Keyword = { fg = palette.kwcold } +self.groups.Statement = { link = 'Keyword'} +self.groups.Conditional = { link = 'Keyword'} +self.groups.Operator = { link = 'Keyword'} +self.groups.PreProc = { link = 'Keyword' } +self.groups.Macro = { link = 'Keyword' } + +self.groups.Function = { fg = palette.funchot } + +self.groups.String = { fg = palette.string } + +self.groups.Number = { fg = palette.yellow } +self.groups.Boolean = { fg = palette.yellow, bold = true } + +self.groups.Type = { fg = palette.type, italic = true } +self.groups.Char = { fg = palette.type } +self.groups.SpecialChar = { fg = palette.type } +self.groups.DiffAdd = { fg = palette.green } +self.groups.DiffChange = { fg = palette.yellow } +self.groups.DiffDelete = { fg = palette.red } + +self.groups.NormalFloat = { link = 'Normal' } +self.groups.SignColumn = { link = 'Normal' } +-- self.groups.NormalFloat = { bg = colorn { n = 4 } } + +local function diag(name, color) + self.groups['Diagnostic' .. name] = { fg = color } + self.groups['DiagnosticUnderline' .. name] = { sp = color, underline = true } +end + +diag('Warn', palette.orange) +diag('Hint', palette.fg) +diag('Info', palette.blue) +self.groups.Error = { fg = palette.red } +diag('Error', palette.red) +self.groups.ErrorMsg = { link = 'Error' } + +self.groups.Title = { fg = palette.orange } +self.groups.Underlined = { fg = palette.fg, underline = true } +self.groups['@parameter'] = { fg = palette.fg, italic = true } +self.groups['@text.reference'] = { fg = palette.yellow } +self.groups['@text.environment'] = { link = 'Keyword' } +self.groups['@text.environment.name'] = { fg = palette.light } +self.groups['@text.emphasis'] = { italic = true } +self.groups['@text.strong'] = { bold = true } +self.groups.Todo = { link = 'Normal' } + +self = self:resolve_links() +-- self = self:compress() +self:apply() diff --git a/lua/oakgen.lua b/lua/oakgen.lua @@ -0,0 +1,107 @@ +local self = MiniColors.as_colorscheme {} + +local base = MiniColors.convert('#E27950', 'oklch') + +local function colorn(t, clip) + return MiniColors.convert({ + l = t.l or 70, + h = t.h or t.n * (360 / 7) + base.h, + c = t.c or base.c + }, 'hex', { gamut_clip = clip or 'chroma' }) +end + +local new_bg = colorn { n = 0, l = 3.5 } +local new_fg = colorn { n = 0, l = 98 } + +local palette = { + bg = new_bg, + dark = colorn { n = 0, l = 20, c = 5 }, + light = colorn { n = 0, l = 50, c = 5 }, + fg = new_fg, + green = colorn { n = 2 }, + blue = colorn { n = 4 }, + orange = colorn { n = 0 }, + yellow = colorn({ n = 1, l = 80 }, 'lightness'), + red = colorn { h = 30, c = 24, l = 63 }, + + kwcold = colorn { n = 5, c = 11 }, + funchot = colorn { n = 0 }, + string = colorn({ n = 3 }, 'lightness'), + type = colorn { n = 2 }, +} + +self.groups.Normal = { fg = palette.fg, bg = palette.bg } +self.groups.Identifier = { link = 'Normal' } + +self.groups.Search = { bg = palette.orange, fg = palette.bg } + +self.groups.MatchParen = { bg = palette.dark } +self.groups.Visual = { bg = palette.dark } +self.groups.LineNr = { fg = palette.light } +self.groups.CursorLineNr = { bg = palette.dark } +self.groups.StatusLine = { bg = palette.dark, bold = true, fg = palette.fg } +self.groups.StatusLineNC = { bg = palette.dark, fg = palette.fg } +self.groups.WinSeparator = { fg = palette.dark } +self.groups.Pmenu = { bg = palette.dark } +self.groups.PmenuSel = { bg = palette.light } +self.groups.ColorColumn = { bg = palette.bg } +self.groups.CursorColumn = { bg = palette.dark } +self.groups.CursorLine = { bg = palette.dark } + +self.groups.NonText = { fg = palette.dark } + +self.groups.Comment = { fg = palette.light, italic = true } +self.groups.Special = { fg = palette.fg } +self.groups["@namespace"] = { fg = palette.type } + +self.groups.Keyword = { fg = palette.kwcold } +self.groups.Statement = { link = 'Keyword'} +self.groups.Conditional = { link = 'Keyword'} +self.groups.Operator = { link = 'Keyword'} +self.groups.PreProc = { link = 'Keyword' } +self.groups.Macro = { link = 'Keyword' } + +self.groups.Function = { fg = palette.funchot } + +self.groups.String = { fg = palette.string } + +self.groups.Number = { fg = palette.yellow } +self.groups.Boolean = { fg = palette.yellow, bold = true } + +self.groups.Type = { fg = palette.type, italic = true } +self.groups.Char = { fg = palette.type } +self.groups.SpecialChar = { fg = palette.type } +self.groups.DiffAdd = { fg = palette.green } +self.groups.DiffChange = { fg = palette.yellow } +self.groups.DiffDelete = { fg = palette.red } + +self.groups.NormalFloat = { link = 'Normal' } +self.groups.SignColumn = { link = 'Normal' } +-- self.groups.NormalFloat = { bg = colorn { n = 4 } } + +local function diag(name, color) + self.groups['Diagnostic' .. name] = { fg = color } + self.groups['DiagnosticUnderline' .. name] = { sp = color, underline = true } +end + +diag('Warn', palette.orange) +diag('Hint', palette.fg) +diag('Info', palette.blue) +self.groups.Error = { fg = palette.red } +diag('Error', palette.red) +self.groups.ErrorMsg = { link = 'Error' } + +self.groups.Title = { fg = palette.orange } +self.groups.Underlined = { fg = palette.fg, underline = true } +self.groups['@parameter'] = { fg = palette.fg, italic = true } +self.groups['@text.reference'] = { fg = palette.yellow } +self.groups['@text.environment'] = { link = 'Keyword' } +self.groups['@text.environment.name'] = { fg = palette.light } +self.groups['@text.emphasis'] = { italic = true } +self.groups['@text.strong'] = { bold = true } +self.groups.Todo = { link = 'Normal' } + +self = self:resolve_links() +-- self = self:compress() +vim.print(palette) +self:apply()