nvim-colorizer.lua icon indicating copy to clipboard operation
nvim-colorizer.lua copied to clipboard

Bug: 0x colors are not produced

Open Redhawk18 opened this issue 1 year ago • 5 comments

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

Redhawk18 avatar Feb 19 '24 03:02 Redhawk18

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

kayuxx avatar Mar 04 '24 13:03 kayuxx

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

Redhawk18 avatar Mar 04 '24 14:03 Redhawk18

@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,
}

Redhawk18 avatar Mar 11 '24 19:03 Redhawk18

@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

kayuxx avatar Mar 11 '24 21:03 kayuxx

yeah it does not support it

Redhawk18 avatar Mar 11 '24 21:03 Redhawk18