diff options
author | akianonymus <anonymus.aki@gmail.com> | 2023-02-25 19:50:18 +0530 |
---|---|---|
committer | Akshay <anonymus.aki@gmail.com> | 2023-02-25 21:33:51 +0530 |
commit | afbcc17d1279180db28a58044dca39b6e909c6b9 (patch) | |
tree | b3591157065ea2c66bb80115c707a5d1c2696dbd /doc | |
parent | docs: 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')
-rw-r--r-- | doc/colorizer.txt | 25 | ||||
-rw-r--r-- | doc/index.html | 2 | ||||
-rw-r--r-- | doc/modules/colorizer.buffer.html | 2 | ||||
-rw-r--r-- | doc/modules/colorizer.color.html | 48 | ||||
-rw-r--r-- | doc/modules/colorizer.html | 2 | ||||
-rw-r--r-- | doc/modules/colorizer.matcher.html | 2 | ||||
-rw-r--r-- | doc/modules/colorizer.sass.html | 2 | ||||
-rw-r--r-- | doc/modules/colorizer.tailwind.html | 2 | ||||
-rw-r--r-- | doc/modules/colorizer.trie.html | 2 | ||||
-rw-r--r-- | doc/modules/colorizer.utils.html | 2 |
10 files changed, 25 insertions, 64 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 diff --git a/doc/index.html b/doc/index.html index 0db74d8..7735382 100644 --- a/doc/index.html +++ b/doc/index.html @@ -87,7 +87,7 @@ </div> <!-- id="main" --> <div id="about"> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> -<i style="float:right;">Last updated - September </i> +<i style="float:right;">Last updated - February </i> </div> <!-- id="about" --> </div> <!-- id="container" --> </body> 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 @@ </div> <!-- id="main" --> <div id="about"> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> -<i style="float:right;">Last updated - September </i> +<i style="float:right;">Last updated - February </i> </div> <!-- id="about" --> </div> <!-- id="container" --> </body> 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 @@ <td class="summary">Converts an HSL color value to RGB.</td> </tr> <tr> - <td class="name" nowrap><a href="#hsl_function_parser">hsl_function_parser (line, i)</a></td> - <td class="summary">Parse for hsl() css function and return rgb hex.</td> - </tr> - <tr> - <td class="name" nowrap><a href="#hsla_function_parser">hsla_function_parser (line, i)</a></td> - <td class="summary">Parse for hsl() css function and return rgb hex.</td> + <td class="name" nowrap><a href="#hsl_function_parser">hsl_function_parser (line, i, opts)</a></td> + <td class="summary">Parse for hsl() hsla() css function and return rgb hex.</td> </tr> <tr> <td class="name" nowrap><a href="#hue_to_rgb">hue_to_rgb (p, q, t)</a></td> @@ -174,10 +170,11 @@ </dd> <dt> <a name = "hsl_function_parser"></a> - <strong>hsl_function_parser (line, i)</strong> + <strong>hsl_function_parser (line, i, opts)</strong> </dt> <dd> - 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 <h3>Parameters:</h3> @@ -188,42 +185,15 @@ <li><span class="parameter">i</span> number: Index of line from where to start parsing </li> - </ul> - - <h3>Returns:</h3> - <ol> - <li> - number|nil: Index of line where the hsl function ended</li> - <li> - string|nil: rgb hex value</li> - </ol> - - - - -</dd> - <dt> - <a name = "hsla_function_parser"></a> - <strong>hsla_function_parser (line, i)</strong> - </dt> - <dd> - Parse for hsl() css function and return rgb hex. - - - <h3>Parameters:</h3> - <ul> - <li><span class="parameter">line</span> - string: Line to parse - </li> - <li><span class="parameter">i</span> - number: Index of line from where to start parsing + <li><span class="parameter">opts</span> + table: Values passed from matchers like prefix </li> </ul> <h3>Returns:</h3> <ol> <li> - number|nil: Index of line where the hsla function ended</li> + number|nil: Index of line where the hsla/hsl function ended</li> <li> string|nil: rgb hex value</li> </ol> @@ -424,7 +394,7 @@ </div> <!-- id="main" --> <div id="about"> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> -<i style="float:right;">Last updated - September </i> +<i style="float:right;">Last updated - February </i> </div> <!-- id="about" --> </div> <!-- id="container" --> </body> 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 </div> <!-- id="main" --> <div id="about"> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> -<i style="float:right;">Last updated - September </i> +<i style="float:right;">Last updated - February </i> </div> <!-- id="about" --> </div> <!-- id="container" --> </body> 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 </div> <!-- id="main" --> <div id="about"> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> -<i style="float:right;">Last updated - September </i> +<i style="float:right;">Last updated - February </i> </div> <!-- id="about" --> </div> <!-- id="container" --> </body> 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 @@ </div> <!-- id="main" --> <div id="about"> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> -<i style="float:right;">Last updated - September </i> +<i style="float:right;">Last updated - February </i> </div> <!-- id="about" --> </div> <!-- id="container" --> </body> 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 @@ </div> <!-- id="main" --> <div id="about"> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> -<i style="float:right;">Last updated - September </i> +<i style="float:right;">Last updated - February </i> </div> <!-- id="about" --> </div> <!-- id="container" --> </body> 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 @@ </div> <!-- id="main" --> <div id="about"> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> -<i style="float:right;">Last updated - September </i> +<i style="float:right;">Last updated - February </i> </div> <!-- id="about" --> </div> <!-- id="container" --> </body> 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 @@ </div> <!-- id="main" --> <div id="about"> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> -<i style="float:right;">Last updated - September </i> +<i style="float:right;">Last updated - February </i> </div> <!-- id="about" --> </div> <!-- id="container" --> </body> |