Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Html colors list #14

Merged
merged 3 commits into from
Apr 21, 2023
Merged

Html colors list #14

merged 3 commits into from
Apr 21, 2023

Conversation

KaminoU
Copy link
Contributor

@KaminoU KaminoU commented Apr 19, 2023

image

@ziontee113
Copy link
Owner

Hi! Thank you for submitting the PR. It's wonderful.

If possible, can you please include how to make the dressing.nvim config to make colorizer work with it? The html_color picker works fine for me, but there are no colorful display on the items.

Thank you very much.

@KaminoU
Copy link
Contributor Author

KaminoU commented Apr 20, 2023

Hi,

Sorry, my bad, as it was really something optional, I just forgot to mention it. I use the plugin https://github.com/NvChad/nvim-colorizer.lua - I believe that any plugins that can parse the HTML hexa color sould work

Maybe we should add a comment in the READMED.md file, something like "best served with nvim-colorize" 😜

Cheers

@ziontee113
Copy link
Owner

Well I too use the same colorizer plugin, however my dressing search results doesn't show the color highlight. Can you share your colorizer settings? Tyvm 👍

@KaminoU
Copy link
Contributor Author

KaminoU commented Apr 21, 2023

hum... Would you mind to try this one https://github.com/norcalli/nvim-colorizer.lua please ?

my noralli-colorize setup

local _found, colorizer = pcall(require, "colorizer")
if not _found then
  vim.notify("colorizer plugin not found", LOG.WARN)
  return
end

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 = true, -- #RRGGBBAA hex codes
    AARRGGBB = true, -- 0xAARRGGBB hex codes
    rgb_fn = true, -- CSS rgb() and rgba() functions
    hsl_fn = true, -- CSS hsl() and hsla() functions
    css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
    css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
    -- Available modes for `mode`: foreground, background,  virtualtext
    mode = "background",
    -- True is same as normal
    tailwind = false, -- Enable tailwind colors
    -- parsers can contain values used in |user_default_options|
    sass = { enable = false, parsers = { "css" } }, -- Enable sass colors
    virtualtext = "",
    -- update color values even if buffer is not focused
    -- example use: cmp_menu, cmp_docs
    always_update = false,
  },
  -- all the sub-options of filetypes apply to buftypes
  buftypes = {},
}

my dressing setup

local _found, dressing = pcall(require, "dressing")
if not _found then
  vim.notify("dressing plugin not found", LOG.WARN)
  return
end

dressing.setup()

The rendering, should work on any kind of windows/buffers
image

And last, it could also take a lil while to parse/render the color so, try to scroll in the dressing search results to refresh the view ?

@ziontee113
Copy link
Owner

Oh... thanks for sharing.
I put

        user_default_options = {
            always_update = true,
        },

and it shows up 👍

@ziontee113 ziontee113 merged commit 66f4f83 into ziontee113:master Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants