From 5f7680e7e7ccad68bd9962bcbb40dfde1c3669a1 Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Sun, 4 Sep 2022 18:32:02 +0530 Subject: Fix https://github.com/NvChad/nvim-colorizer.lua/issues/12 | Add support for tailwind colors Three methods normal: Use the hardcoded colors lsp: Use lsp to fetch colors both: Use the hardcoded colors and use lsp too if available although this is hardcoding, but working with what we got, has all the colors tailwind provides, atleast the prebuilt ones for new defined colors, have to enable the lsp method Generated using https://github.com/tailwindlabs/tailwindcss/raw/master/src/public/colors.js and https://github.com/tailwindlabs/tailwindcss/raw/master/src/corePlugins.js use a different namespace than default for tailwind lsp method only try to use lsp method if attached Misc changes export the user_default_settings to doc clear name space after the lines are processed for a smooth transition cleanup some code --- doc/modules/colorizer.html | 109 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 91 insertions(+), 18 deletions(-) (limited to 'doc/modules/colorizer.html') diff --git a/doc/modules/colorizer.html b/doc/modules/colorizer.html index 3db15a7..e02633c 100644 --- a/doc/modules/colorizer.html +++ b/doc/modules/colorizer.html @@ -33,6 +33,7 @@

Contents

@@ -155,6 +156,13 @@ USE WITH LUA Clear the highlight cache and reload all buffers. +

Tables

+ + + + + +
user_default_optionsdefaults options.

Fields

@@ -271,8 +279,7 @@ USE WITH LUA setup (config)
- -

Easy to use function if you want the full setup without fine grained control. + Easy to use function if you want the full setup without fine grained control. Setup an autocmd which enables colorizing for the filetypes and options specified.

By default highlights all FileTypes.

@@ -288,26 +295,13 @@ Setup an autocmd which enables colorizing for the filetypes and options specifie
     require("colorizer").setup {
       filetypes = { "*" },
-      user_default_options = {
-        RGB = true, -- #RGB hex codes
-        RRGGBB = true, -- #RRGGBB hex codes
-        names = true, -- "Name" codes like Blue or blue
-        RRGGBBAA = false, -- #RRGGBBAA hex codes
-        AARRGGBB = false, -- 0xAARRGGBB hex codes
-        rgb_fn = false, -- CSS rgb() and rgba() functions
-        hsl_fn = false, -- CSS hsl() and hsla() functions
-        css = false, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
-        css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn
-        -- Available modes for mode: foreground, background,  virtualtext
-        mode = "background", -- Set the display mode.
-        virtualtext = "■",
-      },
+      user_default_options,
       -- all the sub-options of filetypes apply to buftypes
       buftypes = {},
     }
 
- +

For all userdefaultoptions, see |userdefaultoptions|

Parameters:

@@ -373,6 +367,85 @@ Setup an autocmd which enables colorizing for the filetypes and options specifie +
+ +

Tables

+ +
+
+ + user_default_options +
+
+ +

defaults options.

+ +
+  user_default_options = {
+      RGB = true, -- #RGB hex codes
+      RRGGBB = true, -- #RRGGBB hex codes
+      names = true, -- "Name" codes like Blue or blue
+      RRGGBBAA = false, -- #RRGGBBAA hex codes
+      AARRGGBB = false, -- 0xAARRGGBB hex codes
+      rgb_fn = false, -- CSS rgb() and rgba() functions
+      hsl_fn = false, -- CSS hsl() and hsla() functions
+      css = false, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
+      css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn
+      -- Available modes for mode: foreground, background,  virtualtext
+      mode = "background", -- Set the display mode.
+      -- Available methods are false / "normal" / "lsp" / "both"
+      tailwind = false -- Enable tailwind colors
+      virtualtext = "■",
+  }
+
+ + + + +

Fields:

+
    +
  • RGB + boolean +
  • +
  • RRGGBB + boolean +
  • +
  • names + boolean +
  • +
  • RRGGBBAA + boolean +
  • +
  • AARRGGBB + boolean +
  • +
  • rgb_fn + boolean +
  • +
  • hsl_fn + boolean +
  • +
  • css + boolean +
  • +
  • css_fn + boolean +
  • +
  • mode + string +
  • +
  • tailwind + boolean|string +
  • +
  • virtualtext + string +
  • +
+ + + + +

Fields

@@ -404,7 +477,7 @@ Setup an autocmd which enables colorizing for the filetypes and options specifie
generated by LDoc 1.4.6 -Last updated 2022-09-03 17:24:13 +Last updated 2022-09-06 15:06:04
-- cgit v1.2.3-70-g09d2