Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions colors/posterpole-void.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vim.o.termguicolors = true
local posterpole = require("posterpole")
posterpole._colorscheme("posterpole_void")
180 changes: 117 additions & 63 deletions lua/posterpole/colors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,70 +6,124 @@ local M = {}
---@param variant string
---@return Palette
function M.setup(variant)
---@class PaletteColors
---@field posterpole Colors
local variants = {
posterpole = {
-- main colors
mainGray = {
cterm = 240,
hex = hsl.hslToHex(0, 0, 30 + config.brightness + config.fg_saturation),
},
mainBlack = {
cterm = 233,
hex = hsl.hslToHex(0, 5 + config.fg_saturation, 18 + config.brightness),
},
mainYellow = {
cterm = 144,
hex = hsl.hslToHex(25, 15 + config.fg_saturation, 60 + config.brightness),
},
mainOrange = {
cterm = 137,
hex = hsl.hslToHex(25, 45 + config.fg_saturation, 60 + config.brightness),
},
mainWhite = {
cterm = 145,
hex = hsl.hslToHex(35, 10 + config.fg_saturation, 65 + config.brightness),
},
mainGreen = {
cterm = 101,
hex = hsl.hslToHex(140, 10 + config.fg_saturation, 50 + config.brightness),
},
mainCyan = { cterm = 65, hex = hsl.hslToHex(174, 10 + config.fg_saturation, 60 + config.brightness) },
mainBlue = { cterm = 103, hex = hsl.hslToHex(210, 15 + config.fg_saturation, 50 + config.brightness) },
mainPurple = { cterm = 60, hex = hsl.hslToHex(284, 15 + config.fg_saturation, 45 + config.brightness) },
mainPink = { cterm = 139, hex = hsl.hslToHex(314, 20 + config.fg_saturation, 65 + config.brightness) },
mainRed = { cterm = 95, hex = hsl.hslToHex(360, 25 + config.fg_saturation, 55 + config.brightness) },
---@class PaletteColors
---@field posterpole Colors
local variants = {
posterpole_void = {
mainGray = {
cterm = 240,
hex = "#2b2b2b",
},
mainBlack = {
cterm = 233,
hex = "#322e2e",
},
mainYellow = {
cterm = 144,
hex = "#8e8675",
},
mainOrange = {
cterm = 137,
hex = "#b3884f",
},
mainWhite = {
cterm = 145,
hex = "#a09494",
},
mainGreen = {
cterm = 101,
hex = "#778C73",
},
mainCyan = { cterm = 65, hex = "#5F8581" },
mainBlue = { cterm = 103, hex = "#707880" },
mainPurple = { cterm = 60, hex = "#694759" },
mainRed = { cterm = 95, hex = "#6f4b46" },

-- scales
deepRed = { cterm = 95, hex = hsl.hslToHex(0, 30 + config.fg_saturation, 30 + config.brightness) },
deepGreen = { cterm = 237, hex = hsl.hslToHex(150, 10 + config.fg_saturation, 20 + config.brightness) },
brightGreen = { cterm = 236, hex = hsl.hslToHex(160, 30 + config.fg_saturation, 20 + config.brightness) },
brightGray = { cterm = 244, hex = hsl.hslToHex(210, 0, 50 + config.brightness + config.fg_saturation) },
-- scales
deepRed = { cterm = 95, hex = "" },
deepGreen = { cterm = 237, hex = "" },
brightGreen = { cterm = 236, hex = "" },
brightGray = { cterm = 244, hex = "#888280" },

-- main bg colors
bgColor = { cterm = 234, hex = hsl.hslToHex(260, 10 + config.bg_saturation, 15 + config.brightness) },
bgColorNC = { cterm = 236, hex = hsl.hslToHex(260, 10 + config.bg_saturation, 18 + config.brightness) },
bgDarkColor = { cterm = 233, hex = hsl.hslToHex(260, 10 + config.bg_saturation, 14 + config.brightness) },
-- main bg colors
bgColor = { cterm = 234, hex = "#141414" },
bgColorNC = { cterm = 236, hex = "#171717" },
bgDarkColor = { cterm = 233, hex = "" },

--builtin term bright colors
brightTermBlack = { cterm = 241, hex = hsl.hslToHex(0, 5 + config.fg_saturation, 28 + config.brightness) },
brightTermBlue = { cterm = 110, hex = hsl.hslToHex(210, 15 + config.fg_saturation, 60 + config.brightness) },
brightTermCyan = { cterm = 73, hex = hsl.hslToHex(174, 10 + config.fg_saturation, 60 + config.brightness) },
brightTermGreen = { cterm = 108, hex = hsl.hslToHex(140, 10 + config.fg_saturation, 60 + config.brightness) },
brightTermMagenta = {
cterm = 104,
hex = hsl.hslToHex(284, 15 + config.fg_saturation, 55 + config.brightness),
},
brightTermRed = { cterm = 167, hex = hsl.hslToHex(360, 25 + config.fg_saturation, 65 + config.brightness) },
brightTermWhite = { cterm = 253, hex = hsl.hslToHex(35, 10 + config.fg_saturation, 75 + config.brightness) },
brightTermYellow = { cterm = 186, hex = hsl.hslToHex(25, 45 + config.fg_saturation, 70 + config.brightness) },
},
}
--builtin term bright colors
brightTermBlack = { cterm = 241, hex = "" },
brightTermBlue = { cterm = 110, hex = "" },
brightTermCyan = { cterm = 73, hex = "" },
brightTermGreen = { cterm = 108, hex = "" },
brightTermMagenta = {
cterm = 104,
hex = "",
},
brightTermRed = { cterm = 167, hex = "" },
brightTermWhite = { cterm = 253, hex = "" },
brightTermYellow = { cterm = 186, hex = "" },
},
posterpole = {
-- main colors
mainGray = {
cterm = 240,
hex = hsl.hslToHex(0, 0, 30 + config.brightness + config.fg_saturation),
},
mainBlack = {
cterm = 233,
hex = hsl.hslToHex(0, 5 + config.fg_saturation, 18 + config.brightness),
},
mainYellow = {
cterm = 144,
hex = hsl.hslToHex(25, 15 + config.fg_saturation, 60 + config.brightness),
},
mainOrange = {
cterm = 137,
hex = hsl.hslToHex(25, 45 + config.fg_saturation, 60 + config.brightness),
},
mainWhite = {
cterm = 145,
hex = hsl.hslToHex(35, 10 + config.fg_saturation, 65 + config.brightness),
},
mainGreen = {
cterm = 101,
hex = hsl.hslToHex(140, 10 + config.fg_saturation, 50 + config.brightness),
},
mainCyan = { cterm = 65, hex = hsl.hslToHex(174, 10 + config.fg_saturation, 60 + config.brightness) },
mainBlue = { cterm = 103, hex = hsl.hslToHex(210, 15 + config.fg_saturation, 50 + config.brightness) },
mainPurple = { cterm = 60, hex = hsl.hslToHex(284, 15 + config.fg_saturation, 45 + config.brightness) },
mainRed = { cterm = 95, hex = hsl.hslToHex(360, 25 + config.fg_saturation, 55 + config.brightness) },

-- scales
deepRed = { cterm = 95, hex = hsl.hslToHex(0, 30 + config.fg_saturation, 30 + config.brightness) },
deepGreen = { cterm = 237, hex = hsl.hslToHex(150, 10 + config.fg_saturation, 20 + config.brightness) },
brightGreen = { cterm = 236, hex = hsl.hslToHex(160, 30 + config.fg_saturation, 20 + config.brightness) },
brightGray = { cterm = 244, hex = hsl.hslToHex(210, 0, 50 + config.brightness + config.fg_saturation) },

-- main bg colors
bgColor = { cterm = 234, hex = hsl.hslToHex(260, 10 + config.bg_saturation, 15 + config.brightness) },
bgColorNC = { cterm = 236, hex = hsl.hslToHex(260, 10 + config.bg_saturation, 18 + config.brightness) },
bgDarkColor = { cterm = 233, hex = hsl.hslToHex(260, 10 + config.bg_saturation, 14 + config.brightness) },

--builtin term bright colors
brightTermBlack = { cterm = 241, hex = hsl.hslToHex(0, 5 + config.fg_saturation, 28 + config.brightness) },
brightTermBlue = { cterm = 110, hex = hsl.hslToHex(210, 15 + config.fg_saturation, 60 + config.brightness) },
brightTermCyan = { cterm = 73, hex = hsl.hslToHex(174, 10 + config.fg_saturation, 60 + config.brightness) },
brightTermGreen = { cterm = 108, hex = hsl.hslToHex(140, 10 + config.fg_saturation, 60 + config.brightness) },
brightTermMagenta = {
cterm = 104,
hex = hsl.hslToHex(284, 15 + config.fg_saturation, 55 + config.brightness),
},
brightTermRed = { cterm = 167, hex = hsl.hslToHex(360, 25 + config.fg_saturation, 65 + config.brightness) },
brightTermWhite = { cterm = 253, hex = hsl.hslToHex(35, 10 + config.fg_saturation, 75 + config.brightness) },
brightTermYellow = { cterm = 186, hex = hsl.hslToHex(25, 45 + config.fg_saturation, 70 + config.brightness) },
},
}

variants = vim.tbl_deep_extend("force", vim.deepcopy(variants), config.colors)
local colors = variants.posterpole
variants = vim.tbl_deep_extend("force", vim.deepcopy(variants), config.colors)
local colors = variants[variant]

-- transparent
-- FIXME: Should be refactored
local bgColor = colors.bgColor
local bg = bgColor
Expand All @@ -87,10 +141,10 @@ function M.setup(variant)
local bgInactiveColor = config.dim_inactive and colors.bgColorNC or bgNoBG
local bgInactive = bgInactiveColor

---@class Palette
local palette = {
colors = colors,
bgColor = bgColor,
---@class Palette
local palette = {
colors = colors,
bgColor = bgColor,
bg = bg,
fg = colors.mainRed,
bgNoBG = bgNoBG,
Expand Down
79 changes: 39 additions & 40 deletions lua/posterpole/highlighs/basic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,45 @@ local M = {}
---@param config PosterpoleConfig
---@return table
function M.setup(palette, config)
local colors = palette.colors
return {
Normal = { bg = palette.bgNoBG, fg = colors.mainWhite },
NormalNC = { bg = palette.bgInactive, fg = colors.mainWhite },
EndOfBuffer = { bg = palette.bgNoBG, fg = colors.mainGray },
Function = { fg = colors.mainBlue, bold = true },
Boolean = { fg = colors.mainPurple }, -- boolean constants
Character = { fg = colors.mainGreen }, -- character constants
Comment = { fg = colors.mainGray }, -- comments
Constant = { fg = colors.mainOrange, bold = true }, -- (preferred) any constant Delimiter = { fg = gray4 }, -- delimiter characters
Float = { fg = colors.mainPurple }, -- float constants
Error = { fg = palette.fg }, -- (preferred) any erroneous construct
Exception = { fg = palette.fg }, -- 'try', 'catch', 'throw'
Identifier = { fg = colors.mainRed }, -- (preferred) any variable
Keyword = { fg = colors.mainRed }, -- any other keyword
Conditional = { fg = palette.fg }, -- conditionals
Visual = { fg = colors.mainWhite, bg = colors.mainGray },
Repeat = { fg = palette.fg }, -- loop keywords: 'for', 'while' etc
Label = { fg = palette.fg }, -- 'case', 'default', etc
Number = { fg = colors.mainPurple }, -- number constant
Operator = { fg = colors.brightGray }, -- '+', '*', 'sizeof' etc
PreProc = { fg = palette.fg }, -- (preferred) generic preprocessor
Define = { fg = palette.fg }, -- preprocessor '#define'
Include = { fg = palette.fg }, -- preprocessor '#include'
Macro = { fg = colors.mainPurple }, -- macros
PreCondit = { fg = palette.fg }, -- preprocessor conditionals '#if', '#endif' etc
Special = { fg = colors.mainYellow }, -- (preferred) any special symbol
SpecialChar = { link = "Special" }, -- special character in a constant
Delimiter = { fg = colors.mainWhite }, -- special character in a constant
SpecialComment = { fg = palette.fg }, -- special things inside comments
Tag = { fg = palette.fg }, -- can use <C-]> on this
Statement = { fg = palette.fg }, -- (preferred) any statement
String = { fg = colors.mainGreen }, -- string constants
Title = { fg = colors.mainWhite },
Type = { fg = colors.mainPurple }, -- (preferred) 'int', 'long', 'char' etc
StorageClass = { fg = colors.mainBlue }, -- 'static', 'volatile' etc
Structure = { fg = colors.mainBlue }, -- 'struct', 'union', 'enum' etc
Typedef = { fg = colors.mainBlue }, -- 'typedef'
Todo = { fg = "black", bg = colors.mainCyan }, -- (preferred) 'TODO' keywords in comments

local colors = palette.colors
return {
Normal = { bg = palette.bgNoBG, fg = colors.mainWhite},
NormalNC = { bg = palette.bgInactive, fg = colors.mainWhite },
EndOfBuffer = { bg = palette.bgNoBG, fg = colors.mainGray },
Function = { fg = colors.mainBlue, bold = true },
Boolean = { fg = colors.mainPurple }, -- boolean constants
Character = { fg = colors.mainGreen }, -- character constants
Comment = { fg = colors.brightGray }, -- comments
Constant = { fg = colors.mainOrange, bold = true }, -- (preferred) any constant Delimiter = { fg = gray4 }, -- delimiter characters
Float = { fg = colors.mainPurple }, -- float constants
Error = { fg = palette.fg }, -- (preferred) any erroneous construct
Exception = { fg = palette.fg }, -- 'try', 'catch', 'throw'
Identifier = { fg = colors.mainRed }, -- (preferred) any variable
Keyword = { fg = colors.mainRed }, -- any other keyword
Conditional = { fg = palette.fg }, -- conditionals
Visual = { bg = colors.mainGray },
Repeat = { fg = palette.fg }, -- loop keywords: 'for', 'while' etc
Label = { fg = palette.fg }, -- 'case', 'default', etc
Number = { fg = colors.mainPurple }, -- number constant
Operator = { fg = colors.brightGray }, -- '+', '*', 'sizeof' etc
PreProc = { fg = palette.fg }, -- (preferred) generic preprocessor
Define = { fg = palette.fg }, -- preprocessor '#define'
Include = { fg = palette.fg }, -- preprocessor '#include'
Macro = { fg = colors.mainPurple }, -- macros
PreCondit = { fg = palette.fg }, -- preprocessor conditionals '#if', '#endif' etc
Special = { fg = colors.mainYellow }, -- (preferred) any special symbol
SpecialChar = { link = "Special" }, -- special character in a constant
Delimiter = { fg = colors.mainWhite }, -- special character in a constant
SpecialComment = { fg = palette.fg }, -- special things inside comments
Tag = { fg = palette.fg }, -- can use <C-]> on this
Statement = { fg = palette.fg }, -- (preferred) any statement
String = { fg = colors.mainGreen }, -- string constants
Title = { fg = colors.mainWhite },
Type = { fg = colors.mainPurple }, -- (preferred) 'int', 'long', 'char' etc
StorageClass = { fg = colors.mainBlue }, -- 'static', 'volatile' etc
Structure = { fg = colors.mainBlue }, -- 'struct', 'union', 'enum' etc
Typedef = { fg = colors.mainBlue }, -- 'typedef'
Todo = { fg = "black", bg = colors.mainCyan }, -- (preferred) 'TODO' keywords in comments
Added = { fg = colors.mainGreen },
Removed = { fg = colors.mainRed },
Changed = { fg = colors.mainOrange },
Expand Down
1 change: 0 additions & 1 deletion lua/posterpole/types.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
---@field mainCyan? Color
---@field mainBlue? Color
---@field mainPurple? Color
---@field mainPink? Color
---@field mainRed? Color
---@field deepRed? Color
---@field deepGreen? Color
Expand Down