utility/ccc: add inputs and outputs options

Added `ccc.nvim` options `vim.utility.ccc.inputs` and
`vim.utility.ccc.outputs` to make input color systems and output color
formats configurable.
This commit is contained in:
Jens Feodor Nielsen 2025-12-16 16:31:38 +01:00
commit 4d63250a48
3 changed files with 71 additions and 9 deletions

View file

@ -3,6 +3,7 @@
lib,
...
}: let
inherit (lib.strings) concatStringsSep;
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
@ -30,12 +31,8 @@ in {
},
alpha_show = "hide", -- needed when highlighter.lsp is set to true
recognize = { output = true }, -- automatically recognize color format under cursor
inputs = { ccc.input.hsl },
outputs = {
ccc.output.css_hsl,
ccc.output.css_rgb,
ccc.output.hex,
},
inputs = {${concatStringsSep "," (map (input: "ccc.input.${input}") cfg.inputs)}},
outputs = {${concatStringsSep "," (map (output: "ccc.output.${output}") cfg.outputs)}},
convert = {
{ ccc.picker.hex, ccc.output.css_hsl },
{ ccc.picker.css_rgb, ccc.output.css_hsl },