Skip to content
Discussion options

You must be logged in to vote

Basically, this boils down to programming two parts:

In case of HSL the real problem is to convert matched color representation in HSL to its hex string (which is the only big color space Neovim highlight groups support).

Here is an example of how I would do it to highlight one of the CSS formats like hsl(50 80% 40%) (taken from here):

local hsl_to_hex = function(h, s, l)
  -- Actually convert h, s, l numbers into hex color in '#RRGGBB' format
  return '#111111'
end

require('mini.hipatterns').setup({
  highlighters = {
    hsl_color = {
      pattern = 'hsl%(%d+ %d+%% %d+%%%)',
      group = function(_, match)
        l…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@craftzdog
Comment options

@echasnovski
Comment options

Answer selected by craftzdog
Comment options

You must be logged in to vote
1 reply
@echasnovski
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants