The Odyssey colorscheme is based on a 12-color palette, and the main ambiance is represented by a dark shade of green whose origins come from the light sea green color.
104 lines
3.1 KiB
VimL
104 lines
3.1 KiB
VimL
" __
|
|
" ____ ____/ /__ __ _____ _____ ___ __ __
|
|
" / __ \ / __ // / / // ___// ___// _ \ / / / /
|
|
" / /_/ // /_/ // /_/ /(__ )(__ )/ __// /_/ /
|
|
" \____/ \__,_/ \__, //____//____/ \___/ \__, /
|
|
" /____/ /____/
|
|
"
|
|
" You terrible man, foxy, ingenious, never tired of twists and tricks
|
|
"
|
|
" Note: Odyssey is a dark green colorscheme for Vim. It main color, the one of
|
|
" its background, is an approximation of a darker shade of light sea green.
|
|
" This link to the sea is the reason why that colorscheme is named after the
|
|
" Odyssey.
|
|
"
|
|
" Author: Ludovic Koenig <ludovic.koenig@gmail.com>
|
|
" License: MIT
|
|
"
|
|
" Bootstrap {{{
|
|
|
|
let s:colors = {}
|
|
|
|
" }}}
|
|
" Utilities {{{
|
|
|
|
function! s:hsv2hex(hue, saturation, value)
|
|
let l:s = a:saturation / 100.0
|
|
let l:v = a:value / 100.0
|
|
|
|
let l:c = l:v * l:s
|
|
let l:h = a:hue / 60.0
|
|
let l:x = l:c * (1.0 - abs(fmod(l:h, 2) - 1.0))
|
|
|
|
if 0 <= l:h && l:h <= 1
|
|
let l:l = [l:c, l:x, 0.0]
|
|
elseif 1 < l:h && l:h <= 2
|
|
let l:l = [l:x, l:c, 0.0]
|
|
elseif 2 < l:h && l:h <= 3
|
|
let l:l = [0.0, l:c, l:x]
|
|
elseif 3 < l:h && l:h <= 4
|
|
let l:l = [0.0, l:x, l:c]
|
|
elseif 4 < l:h && l:h <= 5
|
|
let l:l = [l:x, 0.0, l:c]
|
|
elseif 5 < l:h && l:h <= 6
|
|
let l:l = [l:c, 0.0, l:x]
|
|
endif
|
|
|
|
let l:m = l:v - l:c
|
|
|
|
let l:l = [l:l[0] + l:m, l:l[1] + l:m, l:l[2] + l:m]
|
|
let l:l = [l:l[0] * 255, l:l[1] * 255, l:l[2] * 255]
|
|
let l:l = [round(l:l[0]), round(l:l[1]), round(l:l[2])]
|
|
let l:l = [float2nr(l:l[0]), float2nr(l:l[1]), float2nr(l:l[2])]
|
|
|
|
let l:f = "%02x"
|
|
return printf(l:f, l:l[0]) . printf(l:f, l:l[0]) . printf(l:f, l:l[0])
|
|
endfunction
|
|
|
|
function! s:HL(group, bg, ...)
|
|
let cbg = get(s:colors, a:bg)
|
|
let histring = 'highlight ' . a:group . ' ' . 'guibg=#'. cbg
|
|
|
|
if a:0 > 0
|
|
let cfg = get(s:colors, a:1)
|
|
let histring .= ' guifg=#'. cfg
|
|
endif
|
|
|
|
let histring .= ' cterm=none'
|
|
execute histring
|
|
endfunction
|
|
|
|
" }}}
|
|
" Colors {{{
|
|
"
|
|
" This section deals with the initialization of the different colors used by
|
|
" the colorscheme. Odyssey is going to use a 12-colors palette. The will be 6
|
|
" colors for the different part of the editor, and 6 colors for the
|
|
" highligting.
|
|
"
|
|
" The s:colors dictionary is initialized in the Bootstrap section.
|
|
|
|
let s:colors.beyondback = s:hsv2hex(177, 20, 6)
|
|
let s:colors.background = s:hsv2hex(177, 20, 11)
|
|
let s:colors.cursorline = s:hsv2hex(177, 25, 16)
|
|
let s:colors.foldedline = s:hsv2hex(177, 25, 21)
|
|
let s:colors.linenumber = s:hsv2hex(177, 9, 55)
|
|
let s:colors.foreground = s:hsv2hex(177, 11, 70)
|
|
|
|
let s:colors.keyword = s:hsv2hex(170, 45, 70)
|
|
let s:colors.error = s:hsv2hex( 0, 45, 70)
|
|
let s:colors.warning = s:hsv2hex( 30, 45, 70)
|
|
let s:colors.procedure = s:hsv2hex(140, 45, 70)
|
|
let s:colors.type = s:hsv2hex(200, 45, 70)
|
|
let s:colors.constant = s:hsv2hex(230, 45, 70)
|
|
|
|
" }}}
|
|
" Default Highlights {{{
|
|
"
|
|
" This section links the different default highlight groups with their
|
|
" associated colors. They appear in the same order than when the highlight
|
|
" command is used.
|
|
|
|
" }}}
|
|
" vim: foldmethod=marker
|