mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-01 16:45:55 +00:00
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:
parent
ef1f22efaf
commit
4d63250a48
3 changed files with 71 additions and 9 deletions
|
|
@ -622,12 +622,20 @@
|
|||
|
||||
- Added gitFiles mapping option to telescope
|
||||
|
||||
[Ring-A-Ding-Ding-Baby](https://github.com/Ring-A-Ding-Ding-Baby)
|
||||
[Ring-A-Ding-Ding-Baby](https://github.com/Ring-A-Ding-Ding-Baby):
|
||||
|
||||
- Aligned `codelldb` adapter setup with [rustaceanvim]’s built-in logic.
|
||||
- Added `languages.rust.dap.backend` option to choose between `codelldb` and
|
||||
`lldb-dap` adapters.
|
||||
|
||||
[Libadoxon](https://github.com/Libadoxon)
|
||||
[Libadoxon](https://github.com/Libadoxon):
|
||||
|
||||
- `toggleterm` open map now also works when in terminal mode
|
||||
|
||||
[jfeo](https://github.com/jfeo):
|
||||
|
||||
[ccc.nvim]: https://github.com/uga-rosa/ccc.nvim
|
||||
|
||||
- Added [ccc.nvim] options {option}`vim.utility.ccc.inputs` and
|
||||
{option}`vim.utility.ccc.outputs` to make input color systems and output color
|
||||
formats configurable.
|
||||
|
|
|
|||
|
|
@ -1,10 +1,67 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) listOf enum;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
in {
|
||||
options.vim.utility.ccc = {
|
||||
enable = mkEnableOption "ccc color picker for neovim";
|
||||
|
||||
inputs = mkOption {
|
||||
type = listOf (enum [
|
||||
"rgb"
|
||||
"hsl"
|
||||
"hwb"
|
||||
"lab"
|
||||
"lch"
|
||||
"oklab"
|
||||
"oklch"
|
||||
"cmyk"
|
||||
"hsluv"
|
||||
"okhsl"
|
||||
"hsv"
|
||||
"okhsv"
|
||||
"xyz"
|
||||
]);
|
||||
default = [
|
||||
"hsl"
|
||||
];
|
||||
description = ''
|
||||
List of color systems to be activated.
|
||||
|
||||
The toggle input mode action toggles in this order. The first one is
|
||||
the default used at the first startup. Once activated, it will keep the
|
||||
previous input mode.
|
||||
'';
|
||||
};
|
||||
|
||||
outputs = mkOption {
|
||||
type = listOf (enum [
|
||||
"hex"
|
||||
"hex_short"
|
||||
"css_hsl"
|
||||
"css_rgb"
|
||||
"css_rgba"
|
||||
"css_hwb"
|
||||
"css_lab"
|
||||
"css_lch"
|
||||
"css_oklab"
|
||||
"css_oklch"
|
||||
"float"
|
||||
]);
|
||||
default = [
|
||||
"css_hsl"
|
||||
"css_rgb"
|
||||
"hex"
|
||||
];
|
||||
description = ''
|
||||
List of output formats to be activated.
|
||||
|
||||
The toggle output mode action toggles in this order. The first one is
|
||||
the default used at the first startup. Once activated, it will keep the
|
||||
previous output mode.
|
||||
'';
|
||||
};
|
||||
|
||||
mappings = {
|
||||
quit = mkMappingOption "Cancel and close the UI without replace or insert" "<Esc>";
|
||||
increase10 = mkMappingOption "Increase the value times delta of the slider" "<L>";
|
||||
|
|
|
|||
|
|
@ -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 },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue