fix hue overflow on farba command
This commit is contained in:
@@ -188,9 +188,18 @@ local bluloco = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- THE FUN COLOUR ONE
|
-- THE FUN COLOUR ONE
|
||||||
|
function wrapHue(h)
|
||||||
|
if h > 360 then
|
||||||
|
return h - (h%360)
|
||||||
|
end
|
||||||
|
if h < 0 then
|
||||||
|
return -1*((-1*h)%360) + 360
|
||||||
|
end
|
||||||
|
return h
|
||||||
|
end
|
||||||
local baseColour = 180
|
local baseColour = 180
|
||||||
vim.api.nvim_create_user_command('FarbaColour', function(opts)
|
vim.api.nvim_create_user_command('FarbaColour', function(opts)
|
||||||
baseColour = tonumber(opts.args)
|
baseColour = wrapHue(tonumber(opts.args))
|
||||||
require("farba").setup({
|
require("farba").setup({
|
||||||
cache = false,
|
cache = false,
|
||||||
mode = "dark", -- "light"|"dark" or let 'vim.o.background' decide with nil
|
mode = "dark", -- "light"|"dark" or let 'vim.o.background' decide with nil
|
||||||
|
|||||||
Reference in New Issue
Block a user