summaryrefslogtreecommitdiffstats
path: root/colors/mellow+.lua
blob: e089bfc93802ec3379dd4a92142513d04f81d364 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
vim.cmd('runtime mellow')
local highlight = function(group, opts, space)
  space = space or 0

  if type(group) == 'table' then
    for i in pairs(group) do
      a.nvim_set_hl(space, group[i], opts)
    end
  elseif type(group) == 'string' then
    a.nvim_set_hl(space, group, opts)
  end
end

local function getcolor(index, fallback)
  return vim.g['terminal_color_' .. index] or fallback
end

local colors = {
  black = getcolor(0, 'Black'),
  red = getcolor(1, 'Red'),
  green = getcolor(2, 'Green'),
  yellow = getcolor(3, 'Yellow'),
  blue = getcolor(4, 'Blue'),
  magenta = getcolor(5, 'Magenta'),
  cyan = getcolor(6, 'Cyan'),
  white = getcolor(7, 'White'),
  bright_black = getcolor(8, 'DarkGrey'),
  bright_red = getcolor(9, 'LightRed'),
  bright_green = getcolor(10, 'LightGreen'),
  bright_yellow = getcolor(11, 'LightYellow'),
  bright_blue = getcolor(12, 'LightBlue'),
  bright_magenta = getcolor(13, 'LightMagenta'),
  bright_cyan = getcolor(14, 'LightCyan'),
  bright_white = getcolor(15, 'LightGray'),
}

if pcall(require, "mellow") then c = require('mellow.colors').dark end

-- vim highlights -------------------------------------------------------------
highlight('CursorLineNr', { bold = true })

-- remove tildas
highlight('EndOfBuffer', { fg = vim.g.terminal_color_background })

-- plugin highlights ----------------------------------------------------------
-- telescope
highlight('TelescopeMatching', { bg = c.gray01 })
highlight('TelescopeNormal', { bg = c.bg_dark })

highlight('TelescopePreviewBorder', { bg = c.bg_dark })
highlight('TelescopePreviewNormal', { bg = c.bg_dark })
highlight('TelescopePreviewTitle', { bg = c.bg_dark, fg = c.bg_dark })

highlight('TelescopePromptBorder', { bg = c.gray01 })
highlight('TelescopePromptNormal', { bg = c.gray01 })
highlight('TelescopePromptPrefix', { bg = c.gray01 })
highlight('TelescopePromptTitle', { bg = c.gray01 })

highlight('TelescopeResultsBorder', { bg = c.bg_dark })
highlight('TelescopeResultsNormal', { bg = c.bg_dark })
highlight('TelescopeResultsTitle', { bg = c.bg_dark, fg = c.bg_dark })

highlight('TelescopeSelection', { bg = vim.g.terminal_color_background })
highlight('TelescopeSelectionCaret', { bg = vim.g.terminal_color_background, fg = c.red})

-- alpha
highlight('AlphaHeader', { fg = colors.blue })
highlight('AlphaText', { fg = colors.blue })
highlight('AlphaShortcut', { bold = true })
highlight('AlphaFooter', { fg = colors.blue })

-- fidget
highlight('FidgetTask', { fg = vim.g.terminal_color_foreground })