" Pina colorscheme for Vim/Neovim
" Author: bjarneo (aka: iamdothash)
" License: MIT
" Upstream: https://github.com/bjarneo/omarchy-pina-theme/blob/main/pina.nvim/colors/pina.vim

" This file has been modified by removing some of the "hi" commands related to
" neovim plugins which I do not use, and by adding/changing some colors.

" NOTE: The name, maintainer, and license lines from the original are copied
" below in their original state. However, I suspect these were inaccurate names
" which were copied from the Frost Theme which bjarneo also owns, so I have
" updated the name above to reflect Pina and have listed bjarneo as the author.

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" Frost colorscheme for Vim/Neovim
" Maintainer: Frost Theme
" License: MIT

set background=dark
hi clear

if exists("syntax_on")
  syntax reset
endif

let g:colors_name = "pina"

" Color definitions
let background   = "#101311"
let foreground   = "#d0d1c9"
let cursor       = "#d0d1c9"
let cursor_lines = "#2c2f2d"

" Colors
let color0  = "#101311"
let color1  = "#7db085"
let color2  = "#b8c082"
let color3  = "#e0d480"
let color4  = "#7dd2b8"
let color5  = "#b5c9a4"
let color6  = "#c5e8c5"
let color7  = "#d0d1c9"
let color8  = "#6b8071"
let color9  = "#8cc098"
let color10 = "#cdd590"
let color11 = "#f2e590"
let color12 = "#92e2c8"
let color13 = "#c8dab8"
let color14 = "#d8f5d8"
let color15 = "#e2e3e3"

" Terminal colors
if has('nvim')
  let g:terminal_color_0 = color0
  let g:terminal_color_1 = color1
  let g:terminal_color_2 = color2
  let g:terminal_color_3 = color3
  let g:terminal_color_4 = color4
  let g:terminal_color_5 = color5
  let g:terminal_color_6 = color6
  let g:terminal_color_7 = color7
  let g:terminal_color_8 = color8
  let g:terminal_color_9 = color9
  let g:terminal_color_10 = color10
  let g:terminal_color_11 = color11
  let g:terminal_color_12 = color12
  let g:terminal_color_13 = color13
  let g:terminal_color_14 = color14
  let g:terminal_color_15 = color15
elseif has('terminal')
  let g:terminal_ansi_colors = [
    \ color0, color1, color2, color3,
    \ color4, color5, color6, color7,
    \ color8, color9, color10, color11,
    \ color12, color13, color14, color15
  \ ]
endif

" Basic highlight groups
exe "hi Normal guifg=" . foreground . " guibg=" . background . " ctermfg=7 ctermbg=0"
exe "hi Cursor guifg=" . background . " guibg=" . cursor . " ctermfg=0 ctermbg=7"
exe "hi CursorLine guibg=" . cursor_lines . " ctermbg=8"
exe "hi CursorColumn guibg=" . cursor_lines . " ctermbg=8"
exe "hi ColorColumn guibg=" . cursor_lines . " ctermbg=8"
exe "hi LineNr guifg=" . color8 . " ctermfg=8"
exe "hi CursorLineNr guifg=" . color7 . " ctermfg=7"

" Syntax highlighting
exe "hi Comment guifg=" . color8 . " ctermfg=8"
exe "hi String guifg=" . color2 . " ctermfg=2"
exe "hi Number guifg=" . color4 . " ctermfg=4"
exe "hi Constant guifg=" . color5 . " ctermfg=5"
exe "hi Identifier guifg=" . color7 . " ctermfg=7"
exe "hi Function guifg=" . color1 . " ctermfg=1"
exe "hi Statement guifg=" . color1 . " ctermfg=1"
exe "hi PreProc guifg=" . color5 . " ctermfg=5"
exe "hi Type guifg=" . color4 . " ctermfg=4"
exe "hi Special guifg=" . color5 . " ctermfg=5"
exe "hi Keyword guifg=" . color1 . " ctermfg=1"
exe "hi Operator guifg=" . color7 . " ctermfg=7"

" UI elements
exe "hi Visual guibg=" . color8 . " ctermbg=8"
exe "hi Search guifg=" . background . " guibg=" . color11 . " ctermfg=0 ctermbg=11"
exe "hi IncSearch guifg=" . background . " guibg=" . color3 . " ctermfg=0 ctermbg=3"
exe "hi StatusLine guifg=" . foreground . " guibg=" . color8 . " ctermfg=7 ctermbg=8"
exe "hi StatusLineNC guifg=" . color8 . " guibg=" . background . " ctermfg=8 ctermbg=0"
exe "hi VertSplit guifg=" . color8 . " ctermfg=8"
exe "hi Pmenu guifg=" . foreground . " guibg=" . color8 . " ctermfg=7 ctermbg=8"
exe "hi PmenuSel guifg=" . background . " guibg=" . color4 . " ctermfg=0 ctermbg=4"
exe "hi TabLine guifg=" . color8 . " guibg=" . background . " ctermfg=8 ctermbg=0"
exe "hi TabLineFill guibg=" . background . " ctermbg=0"
exe "hi TabLineSel guifg=" . foreground . " guibg=" . color8 . " ctermfg=7 ctermbg=8"

" Diff highlighting
exe "hi DiffAdd guifg=" . color2 . " guibg=" . background . " ctermfg=2 ctermbg=0"
exe "hi DiffChange guifg=" . color3 . " guibg=" . background . " ctermfg=3 ctermbg=0"
exe "hi DiffDelete guifg=" . color1 . " guibg=" . background . " ctermfg=1 ctermbg=0"
exe "hi DiffText guifg=" . color11 . " guibg=" . background . " ctermfg=11 ctermbg=0"

" Error and warning
exe "hi Error guifg=" . color1 . " guibg=" . background . " ctermfg=1 ctermbg=0"
exe "hi Warning guifg=" . color3 . " guibg=" . background . " ctermfg=3 ctermbg=0"
exe "hi ErrorMsg guifg=" . color1 . " ctermfg=1"
exe "hi WarningMsg guifg=" . color3 . " ctermfg=3"

" Folding
exe "hi Folded guifg=" . color8 . " guibg=" . background . " ctermfg=8 ctermbg=0"
exe "hi FoldColumn guifg=" . color8 . " guibg=" . background . " ctermfg=8 ctermbg=0"

" File explorer and tree colors
exe "hi Directory guifg=" . color4 . " ctermfg=4"

" Telescope colors
exe "hi TelescopeSelection guifg=" . color7 . " guibg=" . color8 . " ctermfg=7 ctermbg=8"
exe "hi TelescopeSelectionCaret guifg=" . color1 . " ctermfg=1"
exe "hi TelescopeMultiSelection guifg=" . color2 . " ctermfg=2"
exe "hi TelescopeNormal guifg=" . color7 . " ctermfg=7"
exe "hi TelescopeBorder guifg=" . color8 . " ctermfg=8"
exe "hi TelescopePromptBorder guifg=" . color4 . " ctermfg=4"
exe "hi TelescopeResultsBorder guifg=" . color8 . " ctermfg=8"
exe "hi TelescopePreviewBorder guifg=" . color8 . " ctermfg=8"

" LSP and diagnostic colors
exe "hi DiagnosticError guifg=" . color1 . " ctermfg=1"
exe "hi DiagnosticWarn guifg=" . color3 . " ctermfg=3"
exe "hi DiagnosticInfo guifg=" . color4 . " ctermfg=4"
exe "hi DiagnosticHint guifg=" . color8 . " ctermfg=8"
