Back View modus-themes.nvim on Github1 2
vim. cmd [[ set background= dark ]] vim. cmd [[ colorscheme modus ]]
NORMAL init.lua unix utf-8 ☰ 0% 0:2 1 2 3 4 5 6 7 8 9 10 11 12
function ! IsHexColorLight ( color ) abort
let l:raw_color = trim ( a:color , '#' )
let l:red = str2nr ( substitute ( l:raw_color, '(.{2}).{4}' , '1' , 'g' ) , 16 )
let l:green = str2nr ( substitute ( l:raw_color, '.{2}(.{2}).{2}' , '1' , 'g' ) , 16 )
let l:blue = str2nr ( substitute ( l:raw_color, '.{4}(.{2})' , '1' , 'g' ) , 16 )
let l:brightness = (( l:red * 299 ) + ( l:green * 587 ) + ( l:blue * 114 )) / 1000
return l:brightness > 155
endfunction
NORMAL code.vim unix utf-8 ☰ 50% 6:12 Highly accessible themes for Neovim, conforming with the highest standard for color contrast between background and foreground values (WCAG AAA). A Neovim port of the original Modus Themes built for GNU Emacs.
More from modus-themes.nvim 1 2
vim. cmd [[ set background= light ]] vim. cmd [[ colorscheme modus ]]
NORMAL init.lua unix utf-8 ☰ 0% 0:2 1 2 3 4 5 6 7 8 9 10 11 12
function ! IsHexColorLight ( color ) abort
let l:raw_color = trim ( a:color , '#' )
let l:red = str2nr ( substitute ( l:raw_color, '(.{2}).{4}' , '1' , 'g' ) , 16 )
let l:green = str2nr ( substitute ( l:raw_color, '.{2}(.{2}).{2}' , '1' , 'g' ) , 16 )
let l:blue = str2nr ( substitute ( l:raw_color, '.{4}(.{2})' , '1' , 'g' ) , 16 )
let l:brightness = (( l:red * 299 ) + ( l:green * 587 ) + ( l:blue * 114 )) / 1000
return l:brightness > 155
endfunction
NORMAL code.vim unix utf-8 ☰ 50% 6:12