From afbcc17d1279180db28a58044dca39b6e909c6b9 Mon Sep 17 00:00:00 2001 From: akianonymus Date: Sat, 25 Feb 2023 19:50:18 +0530 Subject: feat: Improve hsl parser follow https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/hsl add support for deg, turn and all alpha values merge hsl and hsla into one parser less regex computation --- doc/modules/colorizer.buffer.html | 2 +- doc/modules/colorizer.color.html | 48 +++++++------------------------------ doc/modules/colorizer.html | 2 +- doc/modules/colorizer.matcher.html | 2 +- doc/modules/colorizer.sass.html | 2 +- doc/modules/colorizer.tailwind.html | 2 +- doc/modules/colorizer.trie.html | 2 +- doc/modules/colorizer.utils.html | 2 +- 8 files changed, 16 insertions(+), 46 deletions(-) (limited to 'doc/modules') diff --git a/doc/modules/colorizer.buffer.html b/doc/modules/colorizer.buffer.html index fc0888e..6bce06a 100644 --- a/doc/modules/colorizer.buffer.html +++ b/doc/modules/colorizer.buffer.html @@ -333,7 +333,7 @@
generated by LDoc 1.4.6 -Last updated - September +Last updated - February
diff --git a/doc/modules/colorizer.color.html b/doc/modules/colorizer.color.html index 74d4e55..751214c 100644 --- a/doc/modules/colorizer.color.html +++ b/doc/modules/colorizer.color.html @@ -70,12 +70,8 @@ Converts an HSL color value to RGB. - hsl_function_parser (line, i) - Parse for hsl() css function and return rgb hex. - - - hsla_function_parser (line, i) - Parse for hsl() css function and return rgb hex. + hsl_function_parser (line, i, opts) + Parse for hsl() hsla() css function and return rgb hex. hue_to_rgb (p, q, t) @@ -174,10 +170,11 @@
- hsl_function_parser (line, i) + hsl_function_parser (line, i, opts)
- Parse for hsl() css function and return rgb hex. + Parse for hsl() hsla() css function and return rgb hex. + For more info: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/hsl

Parameters:

@@ -188,42 +185,15 @@
  • i number: Index of line from where to start parsing
  • - - -

    Returns:

    -
      -
    1. - number|nil: Index of line where the hsl function ended
    2. -
    3. - string|nil: rgb hex value
    4. -
    - - - - -
    -
    - - hsla_function_parser (line, i) -
    -
    - Parse for hsl() css function and return rgb hex. - - -

    Parameters:

    -

    Returns:

    1. - number|nil: Index of line where the hsla function ended
    2. + number|nil: Index of line where the hsla/hsl function ended
    3. string|nil: rgb hex value
    @@ -424,7 +394,7 @@
    generated by LDoc 1.4.6 -Last updated - September +Last updated - February
    diff --git a/doc/modules/colorizer.html b/doc/modules/colorizer.html index 9e56230..e9fcd62 100644 --- a/doc/modules/colorizer.html +++ b/doc/modules/colorizer.html @@ -490,7 +490,7 @@ Setup an autocmd which enables colorizing for the filetypes and options specifie
    generated by LDoc 1.4.6 -Last updated - September +Last updated - February
    diff --git a/doc/modules/colorizer.matcher.html b/doc/modules/colorizer.matcher.html index dd142eb..3034bb2 100644 --- a/doc/modules/colorizer.matcher.html +++ b/doc/modules/colorizer.matcher.html @@ -140,7 +140,7 @@ Do not try make the function again if it is present in the cache
    generated by LDoc 1.4.6 -Last updated - September +Last updated - February
    diff --git a/doc/modules/colorizer.sass.html b/doc/modules/colorizer.sass.html index dc4f6f4..cf0d133 100644 --- a/doc/modules/colorizer.sass.html +++ b/doc/modules/colorizer.sass.html @@ -182,7 +182,7 @@
    generated by LDoc 1.4.6 -Last updated - September +Last updated - February
    diff --git a/doc/modules/colorizer.tailwind.html b/doc/modules/colorizer.tailwind.html index c6048ac..346a21a 100644 --- a/doc/modules/colorizer.tailwind.html +++ b/doc/modules/colorizer.tailwind.html @@ -136,7 +136,7 @@
    generated by LDoc 1.4.6 -Last updated - September +Last updated - February
    diff --git a/doc/modules/colorizer.trie.html b/doc/modules/colorizer.trie.html index f2bbd89..9071219 100644 --- a/doc/modules/colorizer.trie.html +++ b/doc/modules/colorizer.trie.html @@ -64,7 +64,7 @@
    generated by LDoc 1.4.6 -Last updated - September +Last updated - February
    diff --git a/doc/modules/colorizer.utils.html b/doc/modules/colorizer.utils.html index a787177..d6a0216 100644 --- a/doc/modules/colorizer.utils.html +++ b/doc/modules/colorizer.utils.html @@ -319,7 +319,7 @@
    generated by LDoc 1.4.6 -Last updated - September +Last updated - February
    -- cgit v1.2.3-70-g09d2