diff --git a/colors/lupan.lua b/colors/lupan.lua index 179ffcc..e779211 100644 --- a/colors/lupan.lua +++ b/colors/lupan.lua @@ -1,8 +1,8 @@ vim.g.colors_name = 'lupan' if vim.o.background == "dark" then package.loaded["lupancolors.lupandark"] = nil - require("lush")(require("lupancolors.lupandark")) + require("lush")(require("lupancolors.lupandark").theme) else package.loaded["lupancolors.lupanlight"] = nil - require("lush")(require("lupancolors.lupanlight")) + require("lush")(require("lupancolors.lupanlight").theme) end diff --git a/lua/lualine/themes/lupan.lua b/lua/lualine/themes/lupan.lua index a16a4e0..4d321bf 100644 --- a/lua/lualine/themes/lupan.lua +++ b/lua/lualine/themes/lupan.lua @@ -4,64 +4,62 @@ local hsl = lush.hsl local colors; if vim.o.background == "dark" then + local c = require('lupancolors.lupandark').colors colors = { - bg = hsl(210, 15, 20).hex, - fg = hsl(210, 30, 85).hex, - linebg = hsl(210, 15, 40).hex, - linefg = hsl(210, 30, 85).hex, - black = hsl(210, 15, 5).hex, - normal = hsl(210, 50, 75).hex, - insert = hsl(130, 50, 75).hex, - visual = hsl(210, 30, 30).hex, - replace = hsl(10, 50, 75).hex, - command = hsl(50, 50, 75).hex, - gray = hsl(210, 10, 60).hex, + bg = c.base.da(70).hex, + normal = c.blue.hex, + insert = c.green.hex, + visual = c.purple.hex, + replace = c.red.hex, + command = c.yellow.hex, + b = { bg = c.base.da(70).hex, fg = c.base.hex }, + c = { bg = c.base.de(50).da(50).hex, fg = c.base.de(50).hex }, + inactive = { bg = c.base.de(50).da(70).hex, fg = c.base.de(50).hex }, } else + local c = require('lupancolors.lupanlight').colors colors = { - bg = hsl(210, 15, 20).hex, - fg = hsl(210, 30, 85).hex, - linebg = hsl(210, 15, 80).hex, - linefg = hsl(210, 15, 20).hex, - black = hsl(210, 15, 5).hex, - normal = hsl(210, 50, 75).hex, - insert = hsl(130, 50, 75).hex, - visual = hsl(210, 30, 30).hex, - replace = hsl(10, 50, 75).hex, - command = hsl(50, 50, 75).hex, - gray = hsl(210, 10, 60).hex, + bg = c.base.li(80).hex, + normal = c.blue.hex, + insert = c.green.hex, + visual = c.purple.hex, + replace = c.red.hex, + command = c.yellow.hex, + b = { bg = c.base.de(50).li(70).hex, fg = c.base.hex }, + c = { bg = c.base.de(00).li(60).hex, fg = c.base.hex }, + inactive = { bg = c.base.de(50).li(40).hex, fg = c.base.da(30).hex }, } end return { normal = { a = { bg = colors.normal, fg = colors.bg }, - b = { bg = colors.black, fg = colors.fg }, - c = { bg = colors.linebg, fg = colors.linefg }, + b = colors.b, + c = colors.c, }, insert = { a = { bg = colors.insert, fg = colors.bg }, - b = { bg = colors.black, fg = colors.fg }, - c = { bg = colors.linebg, fg = colors.linefg }, + b = colors.b, + c = colors.c, }, visual = { - a = { bg = colors.visual, fg = colors.fg }, - b = { bg = colors.black, fg = colors.fg }, - c = { bg = colors.linebg, fg = colors.linefg }, + a = { bg = colors.visual, fg = colors.bg }, + b = colors.b, + c = colors.c, }, replace = { a = { bg = colors.replace, fg = colors.bg }, - b = { bg = colors.black, fg = colors.fg }, - c = { bg = colors.linebg, fg = colors.linefg }, + b = colors.b, + c = colors.c, }, command = { a = { bg = colors.command, fg = colors.bg }, - b = { bg = colors.black, fg = colors.fg }, - c = { bg = colors.linebg, fg = colors.linefg }, + b = colors.b, + c = colors.c, }, inactive = { - a = { bg = colors.black, fg = colors.fg }, - b = { bg = colors.black, fg = colors.bg }, - c = { bg = colors.black, fg = colors.linefg }, + a = colors.inactive, + b = colors.inactive, + c = colors.inactive, }, } diff --git a/lua/lupancolors/lupandark.lua b/lua/lupancolors/lupandark.lua index 9135c25..97d50ee 100644 --- a/lua/lupancolors/lupandark.lua +++ b/lua/lupancolors/lupandark.lua @@ -1,73 +1,80 @@ local lush = require('lush') local hsl = lush.hsl +local M = {} + local base = require('lupancolors.lupan').options.dark.base +M.colors = { + base = base, + red = base.hue(0), + orange = base.hue(30), + yellow = base.hue(60), + yellow_green = base.hue(90), + green = base.hue(120), + aquamarine = base.hue(150), + cyan = base.hue(180), + blue = base.hue(210), + lavender = base.hue(240), + purple = base.hue(270), + fuchsia = base.hue(300), + hot_pink = base.hue(330), +} + ---@diagnostic disable: undefined-global -local theme = lush(function() - local red = base.hue(0) - local orange = base.hue(30) - local yellow = base.hue(60) - local yellow_green = base.hue(90) - local green = base.hue(120) - local aquamarine = base.hue(150) - local cyan = base.hue(180) - local blue = base.hue(210) - local lavender = base.hue(240) - local purple = base.hue(270) - local fuchsia = base.hue(300) - local hot_pink = base.hue(330) - return { - -- See: h highlight-groups - Normal { bg = base.de(65).da(75), fg = base.de(25) }, - CursorLine { bg = Normal.bg.li(10) }, - Visual { bg = Normal.bg.sa(20).li(20) }, - Comment { fg = base.de(75).da(20) }, - CursorColumn { CursorLine }, - LineNr { Comment, gui = "italic" }, - CursorLineNr { fg = blue, bg = CursorLine.bg, gui = "italic" }, - Search { bg = yellow, fg = Normal.bg }, - IncSearch { bg = yellow_green, fg = Normal.bg }, - String { fg = blue }, - PreProc { fg = lavender }, - Statement { fg = orange }, - Type { fg = yellow }, - Identifier { fg = Normal.fg }, - Function { fg = green }, - Operator { fg = aquamarine }, - Special { fg = purple }, - Constant { fg = cyan }, - NonText { fg = Normal.bg.li(10) }, - DiffAdd { fg = green }, - DiffDelete { fg = red }, - diffRemoved { fg = red }, - DiffChange { fg = blue }, - diffChanged { fg = blue }, - SignColumn { Normal }, - diffAdded { DiffAdd }, - MoreMsg { fg = green, gui = "bold" }, - Question { fg = green, gui = "bold" }, - TelescopeSelection { CursorLine }, - WhichKeyFloat { bg = Normal.bg.li(15) }, - DiagnosticError { fg = red }, - DiagnosticWarn { fg = orange }, - DiagnosticInfo { fg = cyan }, - Pmenu { bg = Normal.bg.li(20) }, - PmenuSel { bg = Normal.bg.li(25).sa(20) }, - Error { bg = red.da(25), fg = Normal.bg }, - ErrorMsg { Error }, - MatchParen { fg = hot_pink, gui = "bold" }, - SpecialKey { fg = red }, - Directory { fg = cyan }, - Title { fg = fuchsia, gui = "bold" }, - Conceal { bg = blue.da(40).de(50) }, - SpellBad { fg = red, gui = "underline" }, - SpellRare { fg = Type.fg, gui = "underline" }, - SpellLocal { fg = DiagnosticInfo.fg, gui = "underline" }, - SpellCap { fg = String.fg, gui = "underline" }, - } +M.theme = lush(function() + local c = M.colors + return { + -- See: h highlight-groups + Normal { bg = c.base.de(65).da(75), fg = c.base.de(25) }, + CursorLine { bg = Normal.bg.li(10) }, + Visual { bg = Normal.bg.sa(20).li(20) }, + Comment { fg = c.base.de(75).da(20) }, + CursorColumn { CursorLine }, + LineNr { Comment, gui = "italic" }, + CursorLineNr { fg = c.blue, bg = CursorLine.bg, gui = "italic" }, + Search { bg = c.yellow, fg = Normal.bg }, + IncSearch { bg = c.yellow_green, fg = Normal.bg }, + String { fg = c.blue }, + PreProc { fg = c.lavender }, + Statement { fg = c.orange }, + Type { fg = c.yellow }, + Identifier { fg = Normal.fg }, + Function { fg = c.green }, + Operator { fg = c.aquamarine }, + Special { fg = c.purple }, + Constant { fg = c.cyan }, + NonText { fg = Normal.bg.li(10) }, + DiffAdd { fg = c.green }, + DiffDelete { fg = c.red }, + diffRemoved { fg = c.red }, + DiffChange { fg = c.blue }, + diffChanged { fg = c.blue }, + SignColumn { Normal }, + diffAdded { DiffAdd }, + MoreMsg { fg = c.green, gui = "bold" }, + Question { fg = c.green, gui = "bold" }, + TelescopeSelection { CursorLine }, + WhiKeyFloat { bg = Normal.bg.li(15) }, + DiagnosticError { fg = c.red }, + DiagnosticWarn { fg = c.orange }, + DiagnosticInfo { fg = c.cyan }, + Pmenu { bg = Normal.bg.li(20) }, + PmenuSel { bg = Normal.bg.li(25).sa(20) }, + Error { bg = c.red.da(25), fg = Normal.bg }, + ErrorMsg { Error }, + MatParen { fg = c.hot_pink, gui = "bold" }, + SpecialKey { fg = c.red }, + Directory { fg = c.cyan }, + Title { fg = c.fuchsia, gui = "bold" }, + Conceal { bg = c.blue.da(40).de(50) }, + SpellBad { fg = c.red, gui = "underline" }, + SpellRare { fg = Type.fg, gui = "underline" }, + SpellLocal { fg = DiagnosticInfo.fg, gui = "underline" }, + SpellCap { fg = String.fg, gui = "underline" }, + } end) -return theme +return M -- vi:nowrap:number diff --git a/lua/lupancolors/lupanlight.lua b/lua/lupancolors/lupanlight.lua index ca04c0b..270b671 100644 --- a/lua/lupancolors/lupanlight.lua +++ b/lua/lupancolors/lupanlight.lua @@ -1,73 +1,80 @@ local lush = require('lush') local hsl = lush.hsl +local M = {} + local base = require('lupancolors.lupan').options.light.base +M.colors = { + base = base, + red = base.hue(0), + orange = base.hue(30), + yellow = base.hue(60), + yellow_green = base.hue(90), + green = base.hue(120), + aquamarine = base.hue(150), + cyan = base.hue(180), + blue = base.hue(210), + lavender = base.hue(240), + purple = base.hue(270), + fuchsia = base.hue(300), + hot_pink = base.hue(330), +} + ---@diagnostic disable: undefined-global -local theme = lush(function() - local red = base.hue(0) - local orange = base.hue(30) - local yellow = base.hue(60) - local yellow_green = base.hue(90) - local green = base.hue(120) - local aquamarine = base.hue(150) - local cyan = base.hue(180) - local blue = base.hue(210) - local lavender = base.hue(240) - local purple = base.hue(270) - local fuchsia = base.hue(300) - local hot_pink = base.hue(330) +M.theme = lush(function() + local c = M.colors; return { -- See: h highlight-groups - Normal { bg = base.de(70).li(90), fg = base.de(75) }, + Normal { bg = c.base.de(70).li(90), fg = c.base.de(75) }, CursorLine { bg = Normal.bg.da(4) }, - Visual { bg = base.de(55).li(65) }, - Comment { fg = base.de(60).li(20) }, + Visual { bg = c.base.de(55).li(65) }, + Comment { fg = c.base.de(60).li(20) }, CursorColumn { CursorLine }, LineNr { Comment, gui = "italic" }, - CursorLineNr { fg = blue, bg = CursorLine.bg, gui = "italic" }, - Search { bg = yellow, fg = Normal.bg }, - IncSearch { bg = yellow_green, fg = Normal.bg }, - String { fg = blue }, - PreProc { fg = lavender }, - Statement { fg = orange }, - Type { fg = yellow }, + CursorLineNr { fg = c.blue, bg = CursorLine.bg, gui = "italic" }, + Search { bg = c.yellow, fg = Normal.bg }, + IncSearch { bg = c.yellow_green, fg = Normal.bg }, + String { fg = c.blue }, + PreProc { fg = c.lavender }, + Statement { fg = c.orange }, + Type { fg = c.yellow }, Identifier { fg = Normal.fg }, - Function { fg = green }, - Operator { fg = aquamarine }, - Special { fg = purple }, - Constant { fg = cyan }, + Function { fg = c.green }, + Operator { fg = c.aquamarine }, + Special { fg = c.purple }, + Constant { fg = c.cyan }, NonText { fg = Normal.bg.li(10) }, - DiffAdd { fg = green }, - DiffDelete { fg = red }, - diffRemoved { fg = red }, - DiffChange { fg = blue }, - diffChanged { fg = blue }, + DiffAdd { fg = c.green }, + DiffDelete { fg = c.red }, + diffRemoved { fg = c.red }, + DiffChange { fg = c.blue }, + diffChanged { fg = c.blue }, SignColumn { Normal }, diffAdded { DiffAdd }, - MoreMsg { fg = green, gui = "bold" }, - Question { fg = green, gui = "bold" }, + MoreMsg { fg = c.green, gui = "bold" }, + Question { fg = c.green, gui = "bold" }, TelescopeSelection { CursorLine }, WhichKeyFloat { bg = Normal.bg.da(5) }, - DiagnosticError { fg = red }, - DiagnosticWarn { fg = orange }, - DiagnosticInfo { fg = cyan }, + DiagnosticError { fg = c.red }, + DiagnosticWarn { fg = c.orange }, + DiagnosticInfo { fg = c.cyan }, Pmenu { bg = Normal.bg.da(5) }, PmenuSel { bg = Normal.bg.da(15) }, - Error { bg = red.da(25), fg = Normal.bg }, + Error { bg = c.red.da(25), fg = Normal.bg }, ErrorMsg { Error }, - MatchParen { fg = hot_pink, gui = "bold" }, - SpecialKey { fg = red }, - Directory { fg = cyan }, - Title { fg = fuchsia, gui = "bold" }, + MatchParen { fg = c.hot_pink, gui = "bold" }, + SpecialKey { fg = c.red }, + Directory { fg = c.cyan }, + Title { fg = c.fuchsia, gui = "bold" }, Conceal { bg = Normal.bg.da(15).de(30) }, - SpellBad { fg = red, gui = "underline" }, + SpellBad { fg = c.red, gui = "underline" }, SpellRare { fg = Type.fg, gui = "underline" }, SpellLocal { fg = DiagnosticInfo.fg, gui = "underline" }, SpellCap { fg = String.fg, gui = "underline" }, } end) -return theme +return M -- vi:nowrap:number