NvChad / nvim-colorizer.lua

Maintained fork of the fastest Neovim colorizer
Other
708 stars 47 forks source link

Bug: 0x colors are not produced #73

Open Redhawk18 opened 6 months ago

Redhawk18 commented 6 months ago

Describe the bug colors using 0x prefix are not displayed

To Reproduce Go here in nvim: https://github.com/iced-rs/iced/blob/c76a9eb2ff08ac242ed27d7fb11f536c1cc4411a/style/src/theme/palette.rs#L140

Expected behavior they are displayed just like # colors

Screenshots image

Operating System: opensuse tumbleweed

Neovim Version: 0.9.5

Colorizer Version: commit 85855b3

kayuxx commented 6 months ago

@Redhawk18, this is not a bug. You need to use the AARRGGBB format like this: "0xffff0000"

Redhawk18 commented 6 months ago

Do you have an example, I'm on mobile rn.

Redhawk18 commented 5 months ago

@Redhawk18, this is not a bug. You need to use the AARRGGBB format like this: "0xffff0000"

I updated my config and do not see a differences image

return {
    "NvChad/nvim-colorizer.lua",
    config = function()
        require("colorizer").setup({
            filetypes = { "*" },
            user_default_options = {
                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}
            }
        })
    end,
}
kayuxx commented 5 months ago

@Redhawk18 you do it wrong. The first thing you need to do is to use the opts field.

return {
    "NvChad/nvim-colorizer.lua",
    opts = {
     user_default_options = {
      AARRGGBB = true, -- 0xAARRGGBB hex codes
     }
    },
}

It seems that the plugin does not support the hex format (e.g. 0xff00ff) that you want to achieve. it should be 0xAARRGGBB so it will be like this 0xff00ffff

Redhawk18 commented 5 months ago

yeah it does not support it