local colors = require("horizon-extended.colors")

--TODO: standardize the variables so that if they are the same thing they are calling the same colors and styles
local M = {}
function M.setup()
	local config = require("horizon-extended.config")
	local options = config.options
	local theme = {
		config = options,
		colors = colors.setup(),
	}

	local c = theme.colors

	theme.highlights = {
		Character = { link = "string" }, -- Single characters like 'c' or '\n'
		Comment = { fg = c.mg1, style = options.styles.comments }, -- comments
		Conditional = { fg = c.purple, style = options.styles.conditionals },
		Constant = { fg = c.orange }, -- (preferred) any constant
		Cursor = { fg = c.bg0, bg = c.fg1 },
		CursorColumn = { link = "CursorLine" },
		CursorLine = { bg = c.mg3 },
		Delimiter = { fg = c.fg0, style = options.styles.delimiters }, -- punctuation
		DiffAdd = { bg = c.diffadd },
		DiffChange = { bg = c.diffchange },
		DiffText = { bg = c.difftext },
		DiffDelete = { bg = c.diffdelete },
		Directory = { fg = c.yellow },
		EndOfBuffer = { fg = options.show_end_of_buffer and c.mg1 or c.bg0 },
		ErrorText = { sp = c.red, undercurl = options.undercurl },
		ErrorMsg = { fg = c.red },
		Folded = { fg = c.blue, bg = c.bg2 },
		Function = { fg = c.blue }, -- (preferred) function names
		HintText = { fg = c.green },
		Identifier = { fg = c.red }, -- (preferred) any variable name
		LineNr = { fg = c.mg2 },
		MatchParen = { fg = c.yellow, bg = c.mg0, bold = true },
		Normal = { fg = c.fg0, bg = options.transparent and c.none or c.bg0 }, -- Normal text
		NormalFloat = { fg = c.fg0, bg = options.transparent and c.none or c.bg0 }, -- Normal text in a floating window
		FloatBorder = { fg = c.yellow },
		FloatTitle = { fg = c.red },
		NormalNC = { fg = c.fg0, bg = options.transparent and c.none or c.bg0 }, -- Normal text in a non-current window
		ModeMsg = { fg = c.fg2 },
		MoreMsg = { fg = c.purple },
		CurSearch = { link = "IncSearch" },
		IncSearch = { fg = c.bg0, bg = c.orange },
		PreProc = { fg = c.purple },
		QuickFixLine = { bg = c.bg1, bold = true, undercurl = options.undercurl }, -- Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there.
		Repeat = { fg = c.purple, style = options.styles.loops },
		Search = { fg = c.bg0, bg = c.yellow },
		SignatureMarkText = { fg = c.purple },
		SignatureMarkLine = { bg = c.markline },
		SignColumn = { bg = options.transparent and c.none or c.bg0 },
		SignColumnSB = { bg = c.bg0, fg = c.bg1 },
		Special = { fg = c.peach }, -- special items
		SpellBad = { sp = c.red, undercurl = options.undercurl },
		SpellCap = { sp = c.blue, undercurl = options.undercurl }, -- Word that should start with a capital. |spell| Combined with the highlighting used otherwise.
		SpellLocal = { sp = c.purple, undercurl = options.undercurl }, -- Word that is recognized by the spellchecker as one that is used in another region. |spell| Combined with the highlighting used otherwise.
		SpellRare = { sp = c.green, undercurl = options.undercurl }, -- Word that is recognized by the spellchecker as one that is hardly ever used.  |spell| Combined with the highlighting used otherwise.
		Statement = { fg = c.purple, italic = options.enable_italics }, -- (preferred) any statment (if, for, case, etc.)
		StatusLine = { fg = c.fg0, bg = options.transparent and c.none or c.bg0 }, -- status line of current window
		StatusLineNC = { fg = c.fg2 }, -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window.
		String = { fg = c.green, style = options.styles.strings }, -- Strings
		Tag = { fg = c.red },
		TabLine = { fg = c.fg2 }, -- tab pages line, not active tab page label
		TabLineFill = { bg = c.bg0 }, -- tab pages line, where there are no labels
		TabLineSel = { fg = c.bg0, bg = c.blue }, -- tab pages line, active tab page label
		Title = { fg = c.blue },
		Type = { fg = c.yellow, style = options.styles.types },
		Question = { fg = c.blue },
		Removed = { fg = c.red },
		VertSplit = { fg = c.fg1 },
		Visual = { bg = c.mg2 },
		VisualNOS = { bg = c.bg1 }, -- Visual mode selection when vim is "Not Owning the Selection".
		WarningMsg = { fg = c.red },
		WarningText = { sp = c.yellow, undercurl = true },
		Whitespace = { fg = c.mg3 }, -- "nbsp", "space", "tab" and "trail" in 'listchars'
		WildMenu = { bg = c.bg1 }, -- current match in 'wildmenu' completion
		WinSeparator = { fg = c.mg2 }, -- the column separating vertically split windows
		lCursor = { fg = c.bg0, bg = c.fg0 }, -- the character under the cursor when |language-mapping| is used (see 'guicursor')

		-- Diagnostic
		RedSign = { fg = c.red },
		YellowSign = { fg = c.yellow },
		GreenSign = { fg = c.green },
		BlueSign = { fg = c.blue },
		VirtualTextWarning = { fg = c.yellow },
		VirtualTextError = { fg = c.red },
		VirtualTextInfo = { fg = c.blue },
		VirtualTextHint = { fg = c.green },
		ErrorFloat = { fg = c.red, bg = c.bg1 },
		WarningFloat = { fg = c.yellow, bg = c.bg1 },
		InfoFloat = { fg = c.blue, bg = c.bg1 },
		HintFloat = { fg = c.green, bg = c.bg1 },
		--[[ WinBarNC                   = { fg = c.mg0 }, ]]
		DiagnosticFloatingError = { link = "ErrorFloat" },
		DiagnosticFloatingWarn = { link = "WarningFloat" },
		DiagnosticFloatingInfo = { link = "InfoFloat" },
		DiagnosticFloatingHint = { link = "HintFloat" },
		DiagnosticError = { fg = c.red },
		DiagnosticWarn = { fg = c.yellow },
		DiagnosticInfo = { fg = c.blue },
		DiagnosticHint = { fg = c.green },
		DiagnosticVirtualTextError = { link = "VirtualTextError" },
		DiagnosticVirtualTextWarn = { link = "VirtualTextWarning" },
		DiagnosticVirtualTextInfo = { link = "VirtualTextInfo" },
		DiagnosticVirtualTextHint = { link = "VirtualTextHint" },
		DiagnosticUnderlineError = { link = "ErrorText" },
		DiagnosticUnderlineWarn = { link = "WarningText" },
		DiagnosticUnderlineInfo = { link = "InfoText" },
		DiagnosticUnderlineHint = { link = "HintText" },
		DiagnosticSignError = { link = "RedSign" },
		DiagnosticSignWarn = { link = "YellowSign" },
		DiagnosticSignHiblue = { link = "BlueSign" },
		DiagnosticSignInfo = { link = "GreenSign" },
		-- These groups are for the native LSP client. Some other LSP clients may
		-- use these groups, or use their own. Consult your LSP client's
		-- documentation.
		LspDiagnosticsFloatingError = { link = "DiagnosticFloatingError" },
		LspDiagnosticsFloatingWarning = { link = "DiagnosticFloatingWarn" },
		LspDiagnosticsFloatingInformation = { link = "DiagnosticFloatingInfo" },
		LspDiagnosticsFloatingHint = { link = "DiagnosticFloatingHint" },
		LspDiagnosticsDefaultError = { link = "DiagnosticError" },
		LspDiagnosticsDefaultWarning = { link = "DiagnosticWarn" },
		LspDiagnosticsDefaultInformation = { link = "DiagnosticInfo" },
		LspDiagnosticsDefaultHint = { link = "DiagnosticHint" },
		LspDiagnosticsVirtualTextError = { link = "DiagnosticVirtualTextError" },
		LspDiagnosticsVirtualTextWarning = { link = "DiagnosticVirtualTextWarn" },
		LspDiagnosticsVirtualTextInformation = { link = "DiagnosticVirtualTextInfo" },
		LspDiagnosticsVirtualTextHint = { link = "DiagnosticVirtualTextHint" },
		LspDiagnosticsUnderlineError = { link = "DiagnosticUnderlineError" },
		LspDiagnosticsUnderlineWarning = { link = "DiagnosticUnderlineWarn" },
		LspDiagnosticsUnderlineInformation = { link = "DiagnosticUnderlineInfo" },
		LspDiagnosticsUnderlineHint = { link = "DiagnosticUnderlineHint" },
		LspDiagnosticsSignError = { link = "DiagnosticSignError" },
		LspDiagnosticsSignWarning = { link = "DiagnosticSignWarn" },
		LspDiagnosticsSignInformation = { link = "DiagnosticSignInfo" },
		LspDiagnosticsSignHint = { link = "DiagnosticSignHint" },
		LspReferenceText = { link = "CurrentWord" },
		LspReferenceRead = { link = "CurrentWord" },
		LspReferenceWrite = { link = "CurrentWord" },
		LspCodeLens = { link = "VirtualTextInfo" },
		LspCodeLensSeparator = { link = "VirtualTextHint" },
		LspSignatureActiveParameter = { link = "Search" },
		TermCursor = { link = "Cursor" },
		healthError = { fg = c.red },
		healthSuccess = { fg = c.green },
		healthWarning = { fg = c.yellow },
		ALEErrorSign = { link = "ErrorMsg" },
		ALEWarningSign = { link = "WarningMsg" },

		-- These highlight Groups are for Tree-sitter
		TSAnnotation = { fg = c.purple },
		TSAttribute = { fg = c.purple },
		TSBoolean = { fg = c.orange, style = options.styles.booleans },
		TSCharacter = { fg = c.blue },
		TSComment = { link = "Comment" },
		TSConditional = { link = "Conditional" },
		TSConstBuiltin = { fg = c.blue, italic = true },
		TSConstMacro = { fg = c.blue, italic = true },
		TSConstant = { fg = c.fg0 },
		TSConstructor = { fg = c.green, bold = true },
		TSException = { fg = c.red },
		TSField = { fg = c.green },
		TSFloat = { fg = c.purple },
		TSFuncBuiltin = { fg = c.green, bold = true },
		TSFuncMacro = { fg = c.green, bold = true },
		TSFunction = { fg = c.green, bold = true },
		TSInclude = { fg = c.red },
		TSKeyword = { fg = c.red },
		TSKeywordFunction = { fg = c.red },
		TSKeywordOperator = { fg = c.orange },
		TSLabel = { fg = c.orange },
		TSMethod = { fg = c.green, bold = true },
		TSNamespace = { fg = c.yellow, italic = true },
		TSNone = { fg = c.fg0 },
		TSNumber = { fg = c.purple },
		TSOperator = { fg = c.orange, style = options.styles.operators },
		TSParameter = { fg = c.red },
		TSParameterReference = { fg = c.fg0 },
		TSProperty = { fg = c.red, style = options.styles.properties },
		TSPunctBracket = { fg = c.fg0 },
		TSPunctDelimiter = { fg = c.mg1 },
		TSPunctSpecial = { fg = c.blue },
		TSRepeat = { fg = c.red },
		TSStorageClass = { fg = c.orange },
		TSString = { fg = c.blue },
		TSStringEscape = { fg = c.green },
		TSStringRegex = { fg = c.green },
		TSSymbol = { fg = c.fg0 },
		TSTag = { fg = c.orange },
		TSTagDelimiter = { fg = c.green },
		TSText = { fg = c.green },
		TSStrike = { fg = c.mg1 },
		TSMath = { fg = c.blue },
		TSType = { fg = c.yellow, style = options.styles.types },
		TSTypeBuiltin = { fg = c.yellow, italic = true },
		TSURI = { link = "markdownUrl" },
		TSVariable = { fg = c.fg0 },
		TSVariableBuiltin = { fg = c.yellow, italic = true },

		-- Identifiers
		["@annotation"] = { link = "PreProc" },
		["@attribute"] = { link = "PreProc" },
		["@boolean"] = { link = "TSBoolean" },
		["@character"] = { link = "Character" },
		["@character.printf"] = { link = "SpecialChar" },
		["@character.special"] = { link = "SpecialChar" },
		["@comment"] = { link = "Comment" },
		["@comment.error"] = { fg = c.red },
		["@comment.hint"] = { fg = c.green },
		["@comment.info"] = { fg = c.blue },
		["@comment.note"] = { fg = c.hint },
		["@comment.todo"] = { fg = c.purple },
		["@comment.warning"] = { fg = c.orange },
		["@constant"] = { link = "Constant" },
		["@constant.builtin"] = { link = "Special" },
		["@constant.macro"] = { link = "Define" },
		["@constructor"] = { fg = c.purple }, -- For constructor calls and definitions: `= { }` in Lua, and Java constructors.
		["@constructor.tsx"] = { fg = c.blue },
		["@diff.delta"] = { link = "DiffChange" },
		["@diff.minus"] = { link = "DiffDelete" },
		["@diff.plus"] = { link = "DiffAdd" },
		["@function"] = { link = "Function" },
		["@function.builtin"] = { link = "Special" },
		["@function.call"] = { link = "@function" },
		["@function.macro"] = { link = "Macro" },
		["@function.method"] = { link = "Function" },
		["@function.method.call"] = { link = "@function.method" },
		["@keyword"] = { fg = c.purple, style = options.styles.keywords }, -- For keywords that don't fall in previous categories.
		["@keyword.conditional"] = { link = "Conditional" },
		["@keyword.coroutine"] = { link = "@keyword" },
		["@keyword.debug"] = { link = "Debug" },
		["@keyword.directive"] = { link = "PreProc" },
		["@keyword.directive.define"] = { link = "Define" },
		["@keyword.exception"] = { link = "Exception" },
		["@keyword.function"] = { fg = c.purple, style = options.styles.functions }, -- For keywords used to define a function.
		["@keyword.import"] = { link = "Include" },
		["@keyword.operator"] = { fg = c.purple, style = options.styles.operators },
		["@keyword.repeat"] = { link = "Repeat" },
		["@keyword.return"] = { link = "@keyword" },
		["@keyword.storage"] = { link = "StorageClass" },
		["@label"] = { fg = c.blue }, -- For labels: `label:` in C and `:label:` in Lua.
		["@markup"] = { link = "@none" },
		["@markup.emphasis"] = { italic = true },
		["@markup.environment"] = { link = "Macro" },
		["@markup.environment.name"] = { link = "Type" },
		["@markup.heading"] = { link = "Title" },
		["@markup.italic"] = { italic = true },
		["@markup.link"] = { fg = c.blue },
		["@markup.link.label"] = { link = "SpecialChar" },
		["@markup.link.label.symbol"] = { link = "Identifier" },
		["@markup.link.url"] = { link = "Underlined" },
		["@markup.list"] = { fg = c.blue }, -- For special punctutation that does not fall in the categories before.
		["@markup.list.checked"] = { fg = c.green }, -- For brackets and parens.
		["@markup.list.unchecked"] = { fg = c.blue }, -- For brackets and parens.
		["@markup.math"] = { link = "Special" },
		["@markup.raw"] = { link = "String" },
		["@markup.raw.markdown_inline"] = { fg = c.blue },
		["@markup.strikethrough"] = { strikethrough = true },
		["@markup.strong"] = { bold = true },
		["@markup.underline"] = { underline = true },
		["@module"] = { link = "Include" },
		["@module.builtin"] = { fg = c.red }, -- Variable names that are defined by the languages, like `this` or `self`.
		["@namespace.builtin"] = { link = "@variable.builtin" },
		["@none"] = {},
		["@number"] = { link = "Number" },
		["@number.float"] = { link = "Float" },
		["@operator"] = { fg = c.blue, style = options.styles.operators }, -- For any operator: `+`, but also `->` and `*` in C.
		["@property"] = { fg = c.green, style = options.styles.properties },
		["@punctuation.bracket"] = { fg = c.fg2 }, -- For brackets and parens.
		["@punctuation.delimiter"] = { fg = c.blue }, -- For delimiters ie: `.`
		["@punctuation.special"] = { fg = c.blue }, -- For special symbols (e.g. `{}` in string interpolation)
		["@string"] = { link = "String" },
		["@string.documentation"] = { fg = c.green },
		["@string.escape"] = { fg = c.red }, -- For escape characters within a string.
		["@string.regexp"] = { fg = c.blue }, -- For regexes.
		["@tag"] = { fg = c.red },
		["@tag.builtin"] = { fg = c.red },
		["@tag.delimiter"] = { fg = c.red },
		["@tag.attribute"] = { fg = c.orange, italic = options.enable_italics },
		["@tag.delimiter.tsx"] = { fg = c.blue },
		["@tag.tsx"] = { fg = c.red },
		["@type"] = { link = "Type" },
		["@type.builtin"] = { fg = c.purple },
		["@type.definition"] = { link = "Typedef" },
		["@type.qualifier"] = { link = "@keyword" },
		["@variable"] = { fg = c.red, style = options.styles.variables }, -- Any variable name that does not have another highlight.
		["@variable.builtin"] = { fg = c.red }, -- Variable names that are defined by the languages, like `this` or `self`.
		["@variable.member"] = { fg = c.orange }, -- For fields.
		["@variable.parameter"] = { fg = c.yellow }, -- For parameters of a function.
		["@variable.parameter.builtin"] = { fg = c.yellow }, -- For builtin parameters of a function, e.g. "..." or Smali's p[1-99]
		["@text.reference"] = { fg = c.purple },
		["@text.todo.unchecked"] = { fg = c.blue }, -- For brackets and parens.
		["@text.todo.checked"] = { fg = c.green }, -- For brackets and parens.
		["@text.warning"] = { fg = c.bg, bg = c.yellow },
		["@text.danger"] = { fg = c.fg0, bg = c.red },
		["@text.diff.add"] = { link = "DiffAdd" },
		["@text.diff.delete"] = { link = "DiffDelete" },
		["@namespace"] = { link = "Include" },

		-- LSP Semantic Token Groups
		["@lsp.type.comment"] = { link = "TSComment" },
		["@lsp.type.enum"] = { link = "@type" },
		["@lsp.type.enumMember"] = { link = "TSConstructor" },
		["@lsp.type.interface"] = { fg = c.blue },
		["@lsp.type.keyword"] = { link = "TSKeyword" },
		["@lsp.type.modifier"] = { fg = c.red },
		["@lsp.type.namespace"] = { link = "TSNameSpace" },
		["@lsp.type.parameter"] = { link = "TSParameter" },
		["@lsp.type.property"] = { link = "TSProperty" },
		["@lsp.type.variable"] = { fg = c.red },
		["@lsp.mod.readonly"] = { fg = c.yellow },
		["@lsp.typemod.function"] = { fg = c.blue },
		["@lsp.typemod.macro.defaultLibrary"] = { link = "TSFuncBuiltin" },
		["@lsp.typemod.method.defaultLibrary"] = { link = "TSFuncBuiltin" },
		["@lsp.typemod.operator.injected"] = { link = "TSOperator" },
		["@lsp.typemod.string.injected"] = { link = "@string" },
		["@lsp.typemod.type.defaultLibrary"] = { fg = c.blue },
		["@lsp.typemod.variable.defaultLibrary"] = { link = "TSVariableBuiltin" },
		["@lsp.typemod.variable.injected"] = { link = "TSVariable" },
		["@lsp.typemod.class.declaration"] = { fg = c.yellow },

		-- ts-rainbow
		rainbowcol1 = { fg = c.red },
		rainbowcol2 = { fg = c.orange },
		rainbowcol3 = { fg = c.peach },
		rainbowcol4 = { fg = c.yellow },
		rainbowcol5 = { fg = c.green },
		rainbowcol6 = { fg = c.blue },
		rainbowcol7 = { fg = c.purple },

		-- PLUGINS
		-- Dashboard
		DashboardHeader = { fg = c.red },
		DashboardFooter = { fg = c.red },
		DashboardShortCut = { fg = c.purple },
		DashboardProjectTitle = { fg = c.yellow },
		DashboardProjectIcon = { fg = c.blue },
		DashboardFiles = { fg = c.fg0 },
		DashboardMruTitle = { fg = c.yellow },

		-- Indent Blank Line
		IblIdent = { fg = c.red },
		IblScope = { fg = c.red },
		RainbowRed = { blend = 0, fg = c.red },
		RainbowYellow = { blend = 0, fg = c.yellow },
		RainbowBlue = { blend = 0, fg = c.blue },
		RainbowOrange = { blend = 0, fg = c.orange },
		RainbowGreen = { blend = 0, fg = c.green },
		RainbowViolet = { blend = 0, fg = c.purple },
		RainbowCyan = { blend = 0, fg = c.blue },

		-- Telescope
		TelescopeMatching = { fg = c.purple, bold = true },
		TelescopeBorder = { fg = c.yellow },
		TelescopePromptPrefix = { fg = c.blue },

		-- Neotree
		NeoTreeDirectoryName = { fg = c.yellow },
		NeoTreeDirectoryIcon = { fg = c.yellow },
		NeoTreeSymbolicLinkTarget = { fg = c.purple },
		NeoTreeGitAdded = { fg = c.green },
		NeoTreeGitConflict = { fg = c.red },
		NeoTreeGitDeleted = { fg = c.red },
		NeoTreeGitModified = { fg = c.yellow },
		NeoTreeGitUnstaged = { fg = c.red },
		NeoTreeGitUntracked = { fg = c.blue },
		NeoTreeGitStaged = { fg = c.green },
		NeoTreeFloatBorder = { fg = c.red },
		NeoTreeFloatTitle = { fg = c.red },
		NeoTreeFileNameOpened = { fg = c.blue },

		-- WhichKey
		WhichKey = { fg = c.red },
		WhichKeyGroup = { fg = c.yellow },
		WhichKeyDesc = { fg = c.fg0 },
		WhichKeySeparator = { fg = c.green },
		WhichKeyFloat = { fg = c.yellow },
		WhichKeyBorder = { fg = c.yellow },

		-- Notify
		NotifyBackground = { bg = c.bg0 },
		NotifyERRORBorder = { fg = c.red },
		NotifyWARNBorder = { fg = c.orange },
		NotifyINFOBorder = { fg = c.green },
		NotifyDEBUGBorder = { fg = c.blue },
		NotifyTRACEBorder = { fg = c.purple },
		NotifyERRORIcon = { fg = c.red },
		NotifyWARNIcon = { fg = c.orange },
		NotifyINFOIcon = { fg = c.green },
		NotifyDEBUGIcon = { fg = c.blue },
		NotifyTRACEIcon = { fg = c.purple },
		NotifyERRORTitle = { fg = c.red },
		NotifyWARNTitle = { fg = c.orange },
		NotifyINFOTitle = { fg = c.green },
		NotifyDEBUGTitle = { fg = c.blue },
		NotifyTRACETitle = { fg = c.purple },

		-- Noice
		NoiceCmdlineIcon = { fg = c.purple },
		NoiceCmdlineIconHelp = { fg = c.green },
		NoiceCmdlineIconLua = { fg = c.blue },
		NoiceCmdlinePopupBorder = { fg = c.yellow },
		-- NoiceAttr10 = { fg = c.purple },
		NoiceCompletionItemKindDefault = { fg = c.fg2, bg = c.none },
		NoiceCompletionItemKindKeyword = { fg = c.violet, bg = c.none },
		NoiceCompletionItemKindVariable = { fg = c.purple, bg = c.none },
		NoiceCompletionItemKindConstant = { fg = c.purple, bg = c.none },
		NoiceCompletionItemKindReference = { fg = c.purple, bg = c.none },
		NoiceCompletionItemKindValue = { fg = c.purple, bg = c.none },
		NoiceCompletionItemKindFunction = { fg = c.blue, bg = c.none },
		NoiceCompletionItemKindMethod = { fg = c.blue, bg = c.none },
		NoiceCompletionItemKindConstructor = { fg = c.blue, bg = c.none },
		NoiceCompletionItemKindClass = { fg = c.orange, bg = c.none },
		NoiceCompletionItemKindInterface = { fg = c.orange, bg = c.none },
		NoiceCompletionItemKindStruct = { fg = c.orange, bg = c.none },
		NoiceCompletionItemKindEvent = { fg = c.orange, bg = c.none },
		NoiceCompletionItemKindEnum = { fg = c.orange, bg = c.none },
		NoiceCompletionItemKindUnit = { fg = c.orange, bg = c.none },
		NoiceCompletionItemKindModule = { fg = c.yellow, bg = c.none },
		NoiceCompletionItemKindProperty = { fg = c.green1, bg = c.none },
		NoiceCompletionItemKindField = { fg = c.green1, bg = c.none },
		NoiceCompletionItemKindTypeParameter = { fg = c.green1, bg = c.none },
		NoiceCompletionItemKindEnumMember = { fg = c.green1, bg = c.none },
		NoiceCompletionItemKindOperator = { fg = c.green1, bg = c.none },
		NoiceCompletionItemKindSnippet = { fg = "BLACK", bg = c.none },

		-- Undotree
		UndotreeTimeStamp = { fg = c.yellow },

		-- -- Bufferline
		-- BufferLineFill = { bg = c.bg4 },
		-- BufferLineBackground = { bg = c.bg2 },
		-- BufferLineCloseButton = { fg = c.mg0, bg = c.bg2 },
		-- BufferLineCloseButtonSelected = { fg = c.fg0, bg = c.bg0 },
		-- BufferLineCloseButtonVisible = { fg = c.fg0, bg = c.bg0 },
		-- BufferLineBufferVisible = { fg = c.mg1, bg = c.bg0 },
		-- BufferLineBufferSelected = { bg = c.bg0 },
		-- BufferLineNumbers = { fg = c.mg0, bg = c.bg2 },
		-- BufferLineNumbersVisible = { fg = c.mg1, bg = c.bg0 },
		-- BufferLineNumbersSelected = { bg = c.bg0 },
		-- BufferLineHint = { fg = c.bluedim, bg = c.bg2 },
		-- BufferLineHintSelected = { fg = c.blue, bg = c.bg0 },
		-- BufferLineHintVisible = { fg = c.bluedim, bg = c.bg0 },
		-- BufferLineInfo = { fg = c.greendim, bg = c.bg2 },
		-- BufferLineInfoSelected = { fg = c.green, bg = c.bg0 },
		-- BufferLineInfoVisible = { fg = c.greendim, bg = c.bg0 },
		-- BufferLineWarning = { fg = c.yellowdim, bg = c.bg2 },
		-- BufferLineWarningSelected = { fg = c.yellow, bg = c.bg0 },
		-- BufferLineWarningVisible = { fg = c.yellowdim, bg = c.bg0 },
		-- BufferLineError = { fg = c.reddim, bg = c.bg2 },
		-- BufferLineErrorSelected = { fg = c.red, bg = c.bg0 },
		-- BufferLineErrorVisible = { fg = c.reddim, bg = c.bg0 },
		-- BufferLineSeparator = { fg = c.bg4, bg = c.bg2 },
		-- BufferLineSeparatorSelected = { fg = c.bg4, bg = c.bg0 },
		-- BufferLineSeparatorVisible = { fg = c.bg4, bg = c.bg0 },
		-- BufferLineNeoTree = { fg = c.fg0, bg = c.bg2 },
		-- BufferLineModified = { fg = c.orangedim, bg = c.bg2 },
		-- BufferLineModifiedVisible = { fg = c.orangedim, bg = c.bg0 },
		-- BufferLineModifiedSelected = { fg = c.orange, bg = c.bg0 },

		-- diff
		diffAdded = { fg = c.green },
		diffRemoved = { fg = c.red },
		diffChanged = { fg = c.yellow },
		diffOldFile = { fg = c.yellow },
		diffNewFile = { fg = c.orange },
		diffFile = { fg = c.blue },
		diffLine = { fg = c.mg0 },
		diffIndexLine = { fg = c.purple },

		-- GitSigns
		GitSignsAdd = { link = "GreenSign" }, -- diff mode: Added line |diff.txt|
		GitSignsChange = { link = "YellowSign" }, -- diff mode: Changed line |diff.txt|
		GitSignsDelete = { link = "RedSign" }, -- diff mode: Deleted line |diff.txt|
		GitSignsAddNr = { fg = c.green },
		GitSignsChangeNr = { fg = c.yellow },
		GitSignsDeleteNr = { fg = c.red },
		GitSignsAddLn = { link = "diffAdded" },
		GitSignsDeleteLn = { link = "diffRemoved" },
		GitSignsCurrentLineBlame = { fg = c.mg0 },

		-- Cmp
		CmpDocumentation = { fg = c.fg1, bg = options.transparent and c.none or c.bg1 },
		CmpDocumentationBorder = { fg = c.bg1, bg = options.transparent and c.none or c.bg0 },
		CmpItemKindDefault = { fg = c.fg1, bg = c.none },
		CmpItemAbbrMatch = { fg = c.purple, bold = true },
		CmpItemAbbrMatchFuzzy = { fg = c.purple, bold = true },
		CmpItemAbbr = { fg = c.fg0 },
		CmpItemAbbrDeprecated = { fg = c.mg0 },
		CmpItemMenu = { fg = c.fg0 },
		CmpItemKind = { fg = c.yellow },
		CmpItemKindText = { fg = c.fg0 },
		CmpItemKindMethod = { fg = c.green },
		CmpItemKindFunction = { fg = c.purple },
		CmpItemKindConstructor = { fg = c.green },
		CmpItemKindField = { fg = c.green },
		CmpItemKindVariable = { fg = c.red },
		CmpItemKindClass = { fg = c.yellow },
		CmpItemKindInterface = { fg = c.yellow },
		CmpItemKindModule = { fg = c.yellow },
		CmpItemKindProperty = { fg = c.red },
		CmpItemKindUnit = { fg = c.purple },
		CmpItemKindValue = { fg = c.purple },
		CmpItemKindEnum = { fg = c.yellow },
		CmpItemKindKeyword = { fg = c.red },
		CmpItemKindSnippet = { fg = c.blue },
		CmpItemKindColor = { fg = c.blue },
		CmpItemKindFile = { fg = c.blue },
		CmpItemKindReference = { fg = c.blue },
		CmpItemKindFolder = { fg = c.blue },
		CmpItemKindEnumMember = { fg = c.purple },
		CmpItemKindConstant = { fg = c.blue },
		CmpItemKindStruct = { fg = c.yellow },
		CmpItemKindEvent = { fg = c.orange },
		CmpItemKindOperator = { fg = c.orange },
		CmpItemKindTypeParameter = { fg = c.yellow },
		NavicIconsFile = { fg = c.fg0 },
		NavicIconsModule = { fg = c.yellow },
		NavicIconsNamespace = { fg = c.fg0 },
		NavicIconsPackage = { fg = c.fg0 },
		NavicIconsClass = { fg = c.orange },
		NavicIconsMethod = { fg = c.blue },
		NavicIconsProperty = { fg = c.green },
		NavicIconsField = { fg = c.green },
		NavicIconsConstructor = { fg = c.orange },
		NavicIconsEnum = { fg = c.orange },
		NavicIconsInterface = { fg = c.orange },
		NavicIconsFunction = { fg = c.blue },
		NavicIconsVariable = { fg = c.purple },
		NavicIconsConstant = { fg = c.purple },
		NavicIconsString = { fg = c.green },
		NavicIconsNumber = { fg = c.orange },
		NavicIconsBoolean = { fg = c.orange },
		NavicIconsArray = { fg = c.orange },
		NavicIconsObject = { fg = c.orange },
		NavicIconsKey = { fg = c.purple },
		NavicIconsKeyword = { fg = c.purple },
		NavicIconsNull = { fg = c.orange },
		NavicIconsEnumMember = { fg = c.green },
		NavicIconsStruct = { fg = c.orange },
		NavicIconsEvent = { fg = c.orange },
		NavicIconsOperator = { fg = c.fg0 },
		NavicIconsTypeParameter = { fg = c.green },
		NavicText = { fg = c.fg0 },
		NavicSeparator = { fg = c.fg0 },

		-- LANGUAGES

		-- CSS
		cssAttrComma = { fg = c.fg0 },
		cssBraces = { fg = c.fg0 },
		cssTagName = { fg = c.red, italic = options.enable_italics },
		cssClassNameDot = { fg = c.purple },
		cssClassName = { fg = c.purple, italic = options.enable_italics },
		cssFunctionName = { fg = c.blue },
		cssAttr = { fg = c.orange },
		cssProp = { fg = c.peach },
		cssCommonAttr = { fg = c.red },
		cssPseudoClassId = { fg = c.blue },
		cssPseudoClassFn = { fg = c.green },
		cssPseudoClass = { fg = c.purple },
		cssImportant = { fg = c.red, italic = options.enable_italics },
		cssSelectorOp = { fg = c.orange },
		cssSelectorOp2 = { fg = c.orange },
		cssColor = { fg = c.fg0 },
		cssAttributeSelector = { fg = c.blue },
		cssUnitDecorators = { fg = c.fg0 },
		cssValueLength = { fg = c.fg0 },
		cssValueInteger = { fg = c.fg0 },
		cssValueNumber = { fg = c.fg0 },
		cssValueAngle = { fg = c.fg0 },
		cssValueTime = { fg = c.fg0 },
		cssValueFrequency = { fg = c.fg0 },
		cssVendor = { fg = c.mg0 },
		cssNoise = { fg = c.mg0 },
		cssCustomProp = { fg = c.red },

		-- HTML

		-- JavaScript
		javaScriptNull = { fg = c.blue },
		javaScriptIdentifier = { fg = c.orange },
		javaScriptParens = { fg = c.fg0 },
		javaScriptBraces = { fg = c.fg0 },
		javaScriptGlobal = { fg = c.yellow },
		javaScriptMessage = { fg = c.yellow },
		javaScriptFunction = { fg = c.red, italic = options.enable_italics },
		javaScriptOperator = { fg = c.orange },
		javaScriptMember = { fg = c.blue },

		-- Python
		pythonBuiltin = { fg = c.yellow },
		pythonExceptions = { fg = c.yellow },
		pythonDecoratorName = { fg = c.blue },
		["@function.builtin.python"] = { link = "Function" },

		-- Rust
		rustStructure = { fg = c.orange },
		rustIdentifier = { fg = c.purple },
		rustModPath = { fg = c.orange },
		rustModPathSep = { fg = c.fg0 },
		rustSelf = { fg = c.blue },
		rustSuper = { fg = c.blue },
		rustDeriveTrait = { fg = c.purple, italic = options.enable_italics },
		rustEnumVariant = { fg = c.purple },
		rustMacroVariable = { fg = c.blue },
		rustAssert = { fg = c.blue },
		rustPanic = { fg = c.blue },
		rustPubScopeCrate = { fg = c.purple, italic = options.enable_italics },

		-- MarkDown
		markdownH1 = { fg = c.red, bold = true },
		markdownH2 = { fg = c.orange, bold = true },
		markdownH3 = { fg = c.yellow, bold = true },
		markdownH4 = { fg = c.green, bold = true },
		markdownH5 = { fg = c.blue, bold = true },
		markdownH6 = { fg = c.purple, bold = true },
		markdownUrl = { fg = c.blue, underline = true },
		markdownItalic = { italic = true },
		markdownBold = { bold = true },
		markdownItalicDelimiter = { fg = c.mg0, italic = true },
		markdownCode = { fg = c.green },
		markdownCodeBlock = { fg = c.blue },
		markdownCodeDelimiter = { fg = c.blue },
		markdownBlockquote = { fg = c.fg2 },
		markdownListMarker = { fg = c.red },
		markdownOrderedListMarker = { fg = c.red },
		markdownRule = { fg = c.purple },
		markdownHeadingRule = { fg = c.mg0 },
		markdownUrlDelimiter = { fg = c.mg0 },
		markdownLinkDelimiter = { fg = c.mg0 },
		markdownLinkTextDelimiter = { fg = c.mg0 },
		markdownHeadingDelimiter = { fg = c.mg0 },
		markdownLinkText = { fg = c.purple },
		markdownUrlTitleDelimiter = { fg = c.mg0 },
		markdownIdDeclaration = { link = "markdownLinkText" },
		markdownBoldDelimiter = { fg = c.mg0 },
		markdownId = { fg = c.yellow },
		["@punctuation.special.markdown"] = { fg = c.orange, bold = true },
		["@text.literal.markdown_inline"] = { bg = c.bg0, fg = c.blue },
		["@markup.heading.1.markdown"] = { link = "markdownH1" },
		["@markup.heading.2.markdown"] = { link = "markdownH2" },
		["@markup.heading.3.markdown"] = { link = "markdownH3" },
		["@markup.heading.4.markdown"] = { link = "markdownH4" },
		["@markup.heading.5.markdown"] = { link = "markdownH5" },
		["@markup.heading.6.markdown"] = { link = "markdownH6" },
		["@markup.heading.1.marker.markdown"] = { link = "markdownH1" },
		["@markup.heading.2.marker.markdown"] = { link = "markdownH2" },
		["@markup.heading.3.marker.markdown"] = { link = "markdownH3" },
		["@markup.heading.4.marker.markdown"] = { link = "markdownH4" },
		["@markup.heading.5.marker.markdown"] = { link = "markdownH5" },
		["@markup.heading.6.marker.markdown"] = { link = "markdownH6" },
		["@markup.list.markdown"] = { link = "markdownListMarker" },
		["@markup.quote.markdown"] = { link = "markdownBlockquote" },
		["@markup.strong.markdown_inline"] = { link = "markdownBold" },
		["@markup.italic.markdown_inline"] = { link = "markdownItalic" },
		["@markup.heading.markdown"] = { link = "markdownBold" },
		["@markup.link.label.markdown_inline"] = { link = "markdownLinkText" },
		["@markup.strikethrough.markdown_inline"] = { strikethrough = true },

		-- Ruby
		rubyKeywordAsMethod = { fg = c.green, bold = true },
		rubyInterpolation = { fg = c.yellow },
		rubyInterpolationDelimiter = { fg = c.yellow },
		rubyStringDelimiter = { fg = c.green },
		rubyBlockParameterList = { fg = c.blue },
		rubyDefine = { fg = c.red, italic = options.enable_italics },
		rubyModuleName = { fg = c.purple },
		rubyAccess = { fg = c.orange },
		rubyAttribute = { fg = c.yellow },
		rubyMacro = { fg = c.red, italic = options.enable_italics },
		rubyBangPredicateMethod = { fg = c.purple },
		-- rubyModuleBlock = { fg = c.yellow },
		-- rubyClassBlock = { fg = c.yellow },
		-- rubyMethodBlock = { fg = c.yellow },

		-- sh/zsh
		shRange = { fg = c.fg0 },
		shTestOpr = { fg = c.orange },
		shOption = { fg = c.blue },
		bashStatement = { fg = c.orange },
		shOperator = { fg = c.orange },
		shQuote = { fg = c.green },
		shSet = { fg = c.orange },
		shSetList = { fg = c.blue },
		shSnglCase = { fg = c.orange },
		shVariable = { fg = c.blue },
		shVarAssign = { fg = c.orange },
		shCmdSubRegion = { fg = c.green },
		shCommandSub = { fg = c.orange },
		shFunctionOne = { fg = c.green, bold = true },
		shFunctionKey = { fg = c.red, italic = options.enable_italics },

		-- ZSH
		zshoptionstart = { fg = c.purple, italic = options.enable_italics },
		zshOption = { fg = c.blue },
		zshSubst = { fg = c.yellow },
		zshFunction = { fg = c.green, bold = true },
		zshDeref = { fg = c.blue },
		zshTypes = { fg = c.orange },
		zshVariableDef = { fg = c.blue },

		-- JSON
		jsonKeyword = { fg = c.red },
		-- jsonQuote = { fg = c.red },
		jsonBraces = { fg = c.fg0 },

		-- Java
		javaClassDecl = { fg = c.red, italic = options.enable_italics },
		javaMethodDecl = { fg = c.red, italic = options.enable_italics },
		javaVarArg = { fg = c.green },
		javaAnnotation = { fg = c.blue },
		javaUserLabel = { fg = c.purple },
		javaContant = { fg = c.purple },
		javaTypedef = { fg = c.blue },
		javaFold = { fg = c.purple },
		javaOperator = { fg = c.purple },
		javaParen = { fg = c.fg0 },
		javaParen1 = { fg = c.fg0 },
		javaParen2 = { fg = c.fg0 },
		javaParen3 = { fg = c.fg0 },
		javaParen4 = { fg = c.fg0 },
		javaParen5 = { fg = c.fg0 },

		--  vim
		vimLet = { fg = c.orange },
		vimFunction = { fg = c.green, bold = true },
		vimIsCommand = { fg = c.fg0 },
		vimUserFunc = { fg = c.green, bold = true },
		vimFuncName = { fg = c.green, bold = true },
		vimMap = { fg = c.purple, italic = options.enable_italics },
		vimNotation = { fg = c.blue },
		vimMapLhs = { fg = c.green },
		vimMapRhs = { fg = c.green },
		vimSetEqual = { fg = c.yellow },
		vimOption = { fg = c.blue },
		vimUserAttrbKey = { fg = c.yellow },
		vimUserAttrb = { fg = c.green },
		vimAutoCmdSfxList = { fg = c.blue },
		vimSynType = { fg = c.orange },
		vimHiBang = { fg = c.orange },
		vimSet = { fg = c.yellow },
		vimSetSep = { fg = c.base1 },
		vimContinue = { fg = c.base1 },

		--Make
		makeIdent = { fg = c.blue },
		makeSpecTarget = { fg = c.yellow },
		makeTarget = { fg = c.blue },
		makeCommands = { fg = c.orange },

		-- Cmake
		cmakeCommand = { fg = c.orange },
		cmakeKWconfigure_package_config_file = { fg = c.yellow },
		cmakeKWwrite_basic_package_version_file = { fg = c.yellow },
		cmakeKWExternalProject = { fg = c.blue },
		cmakeKWadd_compile_definitions = { fg = c.blue },
		cmakeKWadd_compile_options = { fg = c.blue },
		cmakeKWadd_custom_command = { fg = c.blue },
		cmakeKWadd_custom_target = { fg = c.blue },
		cmakeKWadd_definitions = { fg = c.blue },
		cmakeKWadd_dependencies = { fg = c.blue },
		cmakeKWadd_executable = { fg = c.blue },
		cmakeKWadd_library = { fg = c.blue },
		cmakeKWadd_link_options = { fg = c.blue },
		cmakeKWadd_subdirectory = { fg = c.blue },
		cmakeKWadd_test = { fg = c.blue },
		cmakeKWbuild_command = { fg = c.blue },
		cmakeKWcmake_host_system_information = { fg = c.blue },
		cmakeKWcmake_minimum_required = { fg = c.blue },
		cmakeKWcmake_parse_arguments = { fg = c.blue },
		cmakeKWcmake_policy = { fg = c.blue },
		cmakeKWconfigure_file = { fg = c.blue },
		cmakeKWcreate_test_sourcelist = { fg = c.blue },
		cmakeKWctest_build = { fg = c.blue },
		cmakeKWctest_configure = { fg = c.blue },
		cmakeKWctest_coverage = { fg = c.blue },
		cmakeKWctest_memcheck = { fg = c.blue },
		cmakeKWctest_run_script = { fg = c.blue },
		cmakeKWctest_start = { fg = c.blue },
		cmakeKWctest_submit = { fg = c.blue },
		cmakeKWctest_test = { fg = c.blue },
		cmakeKWctest_update = { fg = c.blue },
		cmakeKWctest_upload = { fg = c.blue },
		cmakeKWdefine_property = { fg = c.blue },
		cmakeKWdoxygen_add_docs = { fg = c.blue },
		cmakeKWenable_language = { fg = c.blue },
		cmakeKWenable_testing = { fg = c.blue },
		cmakeKWexec_program = { fg = c.blue },
		cmakeKWexecute_process = { fg = c.blue },
		cmakeKWexport = { fg = c.blue },
		cmakeKWexport_library_dependencies = { fg = c.blue },
		cmakeKWfile = { fg = c.blue },
		cmakeKWfind_file = { fg = c.blue },
		cmakeKWfind_library = { fg = c.blue },
		cmakeKWfind_package = { fg = c.blue },
		cmakeKWfind_path = { fg = c.blue },
		cmakeKWfind_program = { fg = c.blue },
		cmakeKWfltk_wrap_ui = { fg = c.blue },
		cmakeKWforeach = { fg = c.blue },
		cmakeKWfunction = { fg = c.blue },
		cmakeKWget_cmake_property = { fg = c.blue },
		cmakeKWget_directory_property = { fg = c.blue },
		cmakeKWget_filename_component = { fg = c.blue },
		cmakeKWget_property = { fg = c.blue },
		cmakeKWget_source_file_property = { fg = c.blue },
		cmakeKWget_target_property = { fg = c.blue },
		cmakeKWget_test_property = { fg = c.blue },
		cmakeKWif = { fg = c.blue },
		cmakeKWinclude = { fg = c.blue },
		cmakeKWinclude_directories = { fg = c.blue },
		cmakeKWinclude_external_msproject = { fg = c.blue },
		cmakeKWinclude_guard = { fg = c.blue },
		cmakeKWinstall = { fg = c.blue },
		cmakeKWinstall_files = { fg = c.blue },
		cmakeKWinstall_programs = { fg = c.blue },
		cmakeKWinstall_targets = { fg = c.blue },
		cmakeKWlink_directories = { fg = c.blue },
		cmakeKWlist = { fg = c.blue },
		cmakeKWload_cache = { fg = c.blue },
		cmakeKWload_command = { fg = c.blue },
		cmakeKWmacro = { fg = c.blue },
		cmakeKWmark_as_advanced = { fg = c.blue },
		cmakeKWmath = { fg = c.blue },
		cmakeKWmessage = { fg = c.blue },
		cmakeKWoption = { fg = c.blue },
		cmakeKWproject = { fg = c.blue },
		cmakeKWqt_wrap_cpp = { fg = c.blue },
		cmakeKWqt_wrap_ui = { fg = c.blue },
		cmakeKWremove = { fg = c.blue },
		cmakeKWseparate_arguments = { fg = c.blue },
		cmakeKWset = { fg = c.blue },
		cmakeKWset_directory_properties = { fg = c.blue },
		cmakeKWset_property = { fg = c.blue },
		cmakeKWset_source_files_properties = { fg = c.blue },
		cmakeKWset_target_properties = { fg = c.blue },
		cmakeKWset_tests_properties = { fg = c.blue },
		cmakeKWsource_group = { fg = c.blue },
		cmakeKWstring = { fg = c.blue },
		cmakeKWsubdirs = { fg = c.blue },
		cmakeKWtarget_compile_definitions = { fg = c.blue },
		cmakeKWtarget_compile_features = { fg = c.blue },
		cmakeKWtarget_compile_options = { fg = c.blue },
		cmakeKWtarget_include_directories = { fg = c.blue },
		cmakeKWtarget_link_directories = { fg = c.blue },
		cmakeKWtarget_link_libraries = { fg = c.blue },
		cmakeKWtarget_link_options = { fg = c.blue },
		cmakeKWtarget_precompile_headers = { fg = c.blue },
		cmakeKWtarget_sources = { fg = c.blue },
		cmakeKWtry_compile = { fg = c.blue },
		cmakeKWtry_run = { fg = c.blue },
		cmakeKWunset = { fg = c.blue },
		cmakeKWuse_mangled_mesa = { fg = c.blue },
		cmakeKWvariable_requires = { fg = c.blue },
		cmakeKWvariable_watch = { fg = c.blue },
		cmakeKWwrite_file = { fg = c.blue },

		-- Yaml
		namlKey = { fg = c.red },
		yamlConstant = { fg = c.purple },

		-- toml
		tomlKey = { fg = c.red },
		tomlBoolean = { fg = c.blue },
		tomlTableArray = { link = "tomlTable" },
		["@property.toml"] = { fg = c.blue },

		-- DOS
		dosiniLabel = { fg = c.purple },
		dosiniValue = { fg = c.fg0 },
		dosiniHeader = { fg = c.red },

		-- mini.hipatterns
		MiniHipatternsFixme = { bg = c.red, fg = c.bg0 },
		MiniHipatternsHack = { bg = c.yellow, fg = c.bg0 },
		MiniHipatternsTodo = { bg = c.blue, fg = c.bg0 },
		MiniHipatternsNote = { bg = c.green, fg = c.bg0 },

		-- Snacks.Dashboard
		SnacksDashboardTitle = { fg = c.red },
		SnacksDashboardHeader = { fg = c.red },
		SnacksDashboardFooter = { fg = c.red },
		SnacksDashboardIcon = { fg = c.green },
		SnacksDashboardFile = { fg = c.fg0 },
		SnacksDashboardDesc = { fg = c.fg0 },
		SnacksDashboardKey = { fg = c.purple },
		SnacksDashboardSpecial = { fg = c.yellow },

		-- Snacks.Picker
		SnacksPickerBoxTitle = { fg = c.green },
		SnacksPickerUndoAdded = { fg = c.green },
		SnacksPickerGitStatusAdded = { fg = c.green },
	}

	theme.defer = {}

	options.on_highlights(theme.highlights, theme.colors)

	return theme
end

return M
