]> git.wincent.com - pinnacle.git/commit
feat: add functions for darkening/lightening highlight groups main master
authorGreg Hurrell <greg@hurrell.net>
Sat, 28 May 2022 17:44:43 +0000 (19:44 +0200)
committerGreg Hurrell <greg@hurrell.net>
Sat, 28 May 2022 17:44:43 +0000 (19:44 +0200)
commit23c7d8d819334715bf10dd275164908c7805fb1a
tree181275503d12d5201d81131644f8ac9350158ad2
parent20a0ecdc4fe8c7254646725c57b452f1e44d9a5f
feat: add functions for darkening/lightening highlight groups

I'm not documenting these yet as I they are probably riddled with bugs,
but they seem to work in the simple test cases that I have tried out so
far. Specifically, I'm doing this in my dotfiles to make floating
windows look better:

    local dark = vim.o.background == 'dark'
    local factor = dark and 0.15 or -0.15
    local normal = pinnacle.adjust_lightness('Normal', factor)
    vim.cmd('highlight! clear NormalFloat')
    vim.cmd('highlight! NormalFloat ' .. pinnacle.highlight(normal))
    normal['fg'] = dark and '#ffffff' or '#000000'
    vim.cmd('highlight! clear FloatBorder')
    vim.cmd('highlight! FloatBorder ' .. pinnacle.highlight(normal))
lua/wincent/pinnacle.lua