AndreM222 / copilot-lualine

This is a component which makes a status icon for copilot.lua
MIT License
53 stars 3 forks source link

feature request: use highlight names for colours #13

Closed abhinavnatarajan closed 2 weeks ago

abhinavnatarajan commented 3 months ago

It would be nice to be able to pass in the names of highlight groups instead of hex values for the sign colours.

AndreM222 commented 2 weeks ago

[!Note] I just pushed a update that contains a function you can use to get the values from the hl groups. I plan on documenting it later.

Here is a code example

            local colors = require('copilot-lualine.colors') -- <------------

            require("lualine").setup({
                    lualine_x = {
                        {
                            'copilot',
                            symbols = {
                                status = {
                                    hl = {
                                        enabled = colors.get_hl_value(0, "DiagnosticWarn", "fg"),  -- <------------
                                        sleep = "#AEB7D0",
                                        disabled = "#6272A4",
                                        warning = "#FFB86C",
                                        unknown = "#FF5555"
                                    }
                                }
                            },
                        },
                        'encoding',
                        'fileformat',
                        'filetype'
                    },
            })