vim.cmd('hi Normal guibg=NONE ctermbg=NONE')
vim.cmd('hi NonText guibg=NONE ctermbg=NONE')
vim.cmd('hi SignColumn guibg=NONE ctermbg=NONE')
vim.cmd('hi VertSplit guibg=NONE ctermbg=NONE')
vim.cmd('hi StatusLine guibg=NONE ctermbg=NONE')
vim.cmd('hi StatusLineNC guibg=NONE ctermbg=NONE')

-- Terminal colors
local Colors = {
  black = { cterm=0, hex=0x0E2221 },      
  red = { cterm=1, hex=0xB33A25 },        
  green = { cterm=2, hex=0x176815 },      
  yellow = { cterm=3, hex=0xCEBE16 },     
  blue = { cterm=4, hex=0x3A6BA9 },       
  magenta = { cterm=5, hex=0x7C63C5 },    
  cyan = { cterm=6, hex=0x1FB9A9 },       
  white = { cterm=7, hex=0xC6C6B5 },      

  bright_black = { cterm=8, hex=0x214C43 },
  bright_red = { cterm=9, hex=0xDA651D },
  bright_green = { cterm=10, hex=0x8FC711 },
  bright_yellow = { cterm=11, hex=0xFCFC56 },
  bright_blue = { cterm=12, hex=0x4590D0 },
  bright_magenta = { cterm=13, hex=0xC28DC6 },
  bright_cyan = { cterm=14, hex=0x7DCAC9 },
  bright_white = { cterm=15, hex=0xDEDEDD },
}

local Highlights = {
  ["Type"] = Colors.bright_red,
  ["Function"] = Colors.blue,
  ["Variable"] = Colors.white,
  ["Keyword"] = Colors.red,
  ["String"] = Colors.bright_cyan,
  ["Comment"] = Colors.bright_black,
  ["Constant"] = Colors.green,
  ["Operator"] = Colors.bright_green,
  ["Parameter"] = Colors.yellow,
  ["Property"] = Colors.yellow,
  ["Identifier"] = Colors.yellow,

  ["@attribute"] = Colors.red,
  ["@comment"] = Colors.bright_black,
  ["@comment.error"] = Colors.red,
  ["@comment.note"] = Colors.blue,
  ["@comment.todo"] = Colors.bright_yellow,
  ["@comment.warning"] = Colors.bright_red,
  ["@function.method"] = Colors.bright_blue,
  ["@label"] = Colors.bright_yellow,
  ["@exception"] = Colors.blue,
  ["@reference"] = Colors.cyan,

  ["@lsp.type.type"] = Colors.bright_red,
  ["@lsp.type.decorator"] = Colors.red,
  ["@lsp.type.enumMember"] = Colors.bright_yellow,
  ["@lsp.type.event"] = Colors.green,
  ["@lsp.type.interface"] = Colors.green,
  ["@lsp.type.macro"] = Colors.magenta,
  ["@lsp.type.modifier"] = Colors.red,
  ["@lsp.type.namespace"] = Colors.cyan,
  ["@lsp.type.regexp"] = Colors.bright_cyan,
  ["@lsp.type.typeParameter"] = Colors.green,

  -- Other
  ["TermCursor"] = Colors.white,
  ["TermCursorNC"] = Colors.bright_white,
  ["TermNormal"] = Colors.bright_black,
  ["TermCursorLine"] = Colors.bright_black,

  ["GitSignsAdd"] = Colors.green,
  ["GitSignsDelete"] = Colors.red,
  ["GitSignsChange"] = Colors.yellow,
  ["@diff.delta"] = Colors.green,
  ["@diff.minus"] = Colors.red,
  ["@diff.plus"] = Colors.green,

  ["DiagnosticError"] = Colors.red,
  ["DiagnosticWarn"] = Colors.yellow,
  ["DiagnosticInfo"] = Colors.cyan,
  ["DiagnosticHint"] = Colors.bright_cyan,
}

for group, color in pairs(Highlights) do
  vim.cmd(string.format("highlight %s ctermfg=%d ctermbg=NONE guifg=#%06X guibg=NONE", group, color.cterm, color.hex))
end
