aboutsummaryrefslogtreecommitdiff
path: root/doc/colorizer.txt
diff options
context:
space:
mode:
authorakianonymus <anonymus.aki@gmail.com>2023-02-25 19:50:18 +0530
committerAkshay <anonymus.aki@gmail.com>2023-02-25 21:33:51 +0530
commitafbcc17d1279180db28a58044dca39b6e909c6b9 (patch)
treeb3591157065ea2c66bb80115c707a5d1c2696dbd /doc/colorizer.txt
parentdocs: fix unquoted string in README (diff)
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
Diffstat (limited to 'doc/colorizer.txt')
-rw-r--r--doc/colorizer.txt25
1 files changed, 8 insertions, 17 deletions
diff --git a/doc/colorizer.txt b/doc/colorizer.txt
index 0aaf865..1727fc4 100644
--- a/doc/colorizer.txt
+++ b/doc/colorizer.txt
@@ -387,9 +387,8 @@ Functions: ~
|hsl_to_rgb| - Converts an HSL color value to RGB.
- |hsl_function_parser| - Parse for hsl() css function and return rgb hex.
-
- |hsla_function_parser| - Parse for hsl() css function and return rgb hex.
+ |hsl_function_parser| - Parse for hsl() hsla() css function and return rgb
+ hex.
|hue_to_rgb| - Convert hsl colour values to rgb.
@@ -434,28 +433,20 @@ hsl_to_rgb({h}, {s}, {l}) *colorizer.color.hsl_to_rgb*
-hsl_function_parser({line}, {i}) *colorizer.color.hsl_function_parser*
- Parse for hsl() css function and return rgb hex.
-
- Parameters: ~
- {line} - string: Line to parse
- {i} - number: Index of line from where to start parsing
-
- returns:~
- number or nil: Index of line where the hsl function ended
- string or nil: rgb hex value
-
+hsl_function_parser({line}, {i}, {opts}) *colorizer.color.hsl_function_parser*
+ 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
-hsla_function_parser({line}, {i}) *colorizer.color.hsla_function_parser*
- Parse for hsl() css function and return rgb hex.
Parameters: ~
{line} - string: Line to parse
{i} - number: Index of line from where to start parsing
+ {opts} - table: Values passed from matchers like prefix
returns:~
- number or nil: Index of line where the hsla function ended
+ number or nil: Index of line where the hsla/hsl function ended
string or nil: rgb hex value