2024-07-14 22:32:55 +08:00
|
|
|
--=============================================================================
|
|
|
|
-- cpicker.lua
|
|
|
|
-- Copyright (c) 2019-2024 Wang Shidong & Contributors
|
|
|
|
-- Author: Wang Shidong < wsdjeg@outlook.com >
|
|
|
|
-- URL: https://spacevim.org
|
|
|
|
-- License: GPLv3
|
|
|
|
--=============================================================================
|
|
|
|
|
|
|
|
if vim.api.nvim_create_user_command then
|
2024-07-16 01:07:35 +08:00
|
|
|
local function complete()
|
|
|
|
return { 'rgb', 'hsl', 'hsv', 'cmyk', 'hwb' }
|
2024-07-14 22:32:55 +08:00
|
|
|
end
|
|
|
|
vim.api.nvim_create_user_command('Cpicker', function(opt)
|
|
|
|
require('cpicker').picker(opt.fargs)
|
|
|
|
end, { nargs = '*', complete = complete })
|
|
|
|
vim.api.nvim_create_user_command('CpickerCursorForeground', function(opt)
|
|
|
|
require('cpicker.util').set_default_color(opt.fargs)
|
|
|
|
require('cpicker').picker(opt.fargs)
|
2024-07-16 01:07:35 +08:00
|
|
|
end, { nargs = '*', complete = complete })
|
|
|
|
vim.api.nvim_create_user_command('CpickerColorMix', function(opt)
|
2024-07-16 17:37:49 +08:00
|
|
|
require('cpicker.mix').color_mix(unpack(opt.fargs))
|
2024-07-14 22:32:55 +08:00
|
|
|
end, { nargs = '*', complete = complete })
|
|
|
|
end
|