Reviewed-on: #1 Co-authored-by: Tomas Mirchev <contact@tomastm.com> Co-committed-by: Tomas Mirchev <contact@tomastm.com>
54 lines
878 B
Lua
54 lines
878 B
Lua
local M = {}
|
|
|
|
local modes = {
|
|
ansi = {
|
|
black = 0,
|
|
red = 1,
|
|
green = 2,
|
|
yellow = 3,
|
|
blue = 4,
|
|
magenta = 5,
|
|
cyan = 6,
|
|
white = 7,
|
|
},
|
|
default = {
|
|
black = 238,
|
|
red = 196,
|
|
green = 35,
|
|
yellow = 221,
|
|
blue = 27,
|
|
magenta = 125,
|
|
cyan = 30,
|
|
white = 255,
|
|
},
|
|
}
|
|
|
|
local shared_palette = {
|
|
gray_dark = 245,
|
|
gray = 247,
|
|
gray_light = 253,
|
|
orange = 166,
|
|
orange_light = 180,
|
|
yellow_light = 180,
|
|
blue_light = 153,
|
|
slate_indigo = 60,
|
|
}
|
|
|
|
---Get color palette
|
|
---@param mode '"ansi"'|'"default"'
|
|
---@return table
|
|
function M.get(mode)
|
|
local mode_palette = modes[mode]
|
|
if not mode_palette then
|
|
vim.notify(
|
|
string.format('Invalid palette mode: "%s" (valid: ansi, default)', tostring(mode)),
|
|
vim.log.levels.WARN,
|
|
{ title = "palette" }
|
|
)
|
|
mode_palette = modes.default
|
|
end
|
|
return vim.tbl_extend("force", mode_palette, shared_palette)
|
|
end
|
|
|
|
return M
|