Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions doc/colorizer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ user_default_options *colorizer.config.user_default_options*
hooks - table: Table of hook functions
{disable_line_highlight} - function: Returns boolean which controls if
line should be parsed for highlights
{xterm} - boolean: Enables xterm 256-color codes (#xNN, \e[38;5;NNNm)



Expand Down Expand Up @@ -1010,6 +1011,46 @@ parser({line}, {i}, {opts}) *colorizer.parser.rgb.parser*



==============================================================================
XTERM *colorizer.parser.xterm-introduction*

This module provides a parser for identifying and converting xterm color codes
to RGB hexadecimal format.

It supports both #xNN format (decimal, 0-255) and ANSI escape sequences
\e[38;5;NNNm for xterm 256-color palette.
The function reads the color code and returns the corresponding RGB hex string
from the xterm color palette.

==============================================================================
LUA API *colorizer.parser.xterm-lua-api*

Functions: ~
|parser| - Parses xterm color codes and converts them to RGB hex format.


parser({line}, {i}) *colorizer.parser.xterm.parser*
Parses xterm color codes and converts them to RGB hex format.

This function matches both #xNN format (decimal, 0-255) and ANSI escape
sequences \e[38;5;NNNm
for xterm 256-color palette. It returns the corresponding RGB hex string
from the xterm color palette.


Parameters: ~
{line} - string: The line of text to parse for xterm color codes
{i} - number: The starting index within the line where parsing should
begin

returns:~
number or nil: The end index of the parsed xterm color code within the
line, or `nil` if parsing failed
string or nil: The RGB hexadecimal color from the xterm palette, or
`nil` if parsing failed



==============================================================================
SASS *colorizer.sass-introduction*

Expand Down
7 changes: 6 additions & 1 deletion doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ <h2>Modules</h2>
<li><a href="modules/colorizer.parser.names.html">parser.names</a></li>
<li><a href="modules/colorizer.parser.rgb.html">parser.rgb</a></li>
<li><a href="modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
<li><a href="modules/colorizer.parser.xterm.html">parser.xterm</a></li>
<li><a href="modules/colorizer.sass.html">sass</a></li>
<li><a href="modules/colorizer.tailwind.html">tailwind</a></li>
<li><a href="modules/trie.html">trie</a></li>
Expand Down Expand Up @@ -102,6 +103,10 @@ <h2>Modules</h2>
<td class="name" nowrap><a href="modules/colorizer.parser.rgba_hex.html">colorizer.parser.rgba_hex</a></td>
<td class="summary">This module provides a parser for identifying and converting `#RRGGBBAA` hexadecimal color values to RGB hexadecimal format.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/colorizer.parser.xterm.html">colorizer.parser.xterm</a></td>
<td class="summary">This module provides a parser for identifying and converting xterm color codes to RGB hexadecimal format.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/colorizer.sass.html">colorizer.sass</a></td>
<td class="summary">Manages Sass variable parsing and color detection for buffers.</td>
Expand All @@ -128,7 +133,7 @@ <h2>Modules</h2>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated - January </i>
<i style="float:right;">Last updated - July </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 2 additions & 1 deletion doc/modules/colorizer.buffer.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ <h2>Modules</h2>
<li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
<li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
<li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
<li><a href="../modules/colorizer.sass.html">sass</a></li>
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
<li><a href="../modules/trie.html">trie</a></li>
Expand Down Expand Up @@ -233,7 +234,7 @@ <h3>Returns:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated - January </i>
<i style="float:right;">Last updated - July </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 2 additions & 1 deletion doc/modules/colorizer.color.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ <h2>Modules</h2>
<li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
<li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
<li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
<li><a href="../modules/colorizer.sass.html">sass</a></li>
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
<li><a href="../modules/trie.html">trie</a></li>
Expand Down Expand Up @@ -202,7 +203,7 @@ <h3>Returns:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated - January </i>
<i style="float:right;">Last updated - July </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
6 changes: 5 additions & 1 deletion doc/modules/colorizer.config.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ <h2>Modules</h2>
<li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
<li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
<li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
<li><a href="../modules/colorizer.sass.html">sass</a></li>
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
<li><a href="../modules/trie.html">trie</a></li>
Expand Down Expand Up @@ -335,6 +336,9 @@ <h3>Fields:</h3>
function: Returns boolean which controls if line should be parsed for highlights
</li>
</li></ul>
<li><span class="parameter">xterm</span>
boolean: Enables xterm 256-color codes (#xNN, \e[38;5;NNNm)
</li>
</ul>


Expand Down Expand Up @@ -456,7 +460,7 @@ <h3>Fields:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated - January </i>
<i style="float:right;">Last updated - July </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 2 additions & 1 deletion doc/modules/colorizer.constants.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ <h2>Modules</h2>
<li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
<li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
<li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
<li><a href="../modules/colorizer.sass.html">sass</a></li>
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
<li><a href="../modules/trie.html">trie</a></li>
Expand Down Expand Up @@ -226,7 +227,7 @@ <h3>Fields:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated - January </i>
<i style="float:right;">Last updated - July </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 2 additions & 1 deletion doc/modules/colorizer.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ <h2>Modules</h2>
<li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
<li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
<li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
<li><a href="../modules/colorizer.sass.html">sass</a></li>
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
<li><a href="../modules/trie.html">trie</a></li>
Expand Down Expand Up @@ -449,7 +450,7 @@ <h3>Usage:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated - January </i>
<i style="float:right;">Last updated - July </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 2 additions & 1 deletion doc/modules/colorizer.matcher.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ <h2>Modules</h2>
<li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
<li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
<li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
<li><a href="../modules/colorizer.sass.html">sass</a></li>
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
<li><a href="../modules/trie.html">trie</a></li>
Expand Down Expand Up @@ -138,7 +139,7 @@ <h3>Returns:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated - January </i>
<i style="float:right;">Last updated - July </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 2 additions & 1 deletion doc/modules/colorizer.parser.hsl.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ <h2>Modules</h2>
<li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
<li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
<li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
<li><a href="../modules/colorizer.sass.html">sass</a></li>
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
<li><a href="../modules/trie.html">trie</a></li>
Expand Down Expand Up @@ -126,7 +127,7 @@ <h3>Returns:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated - January </i>
<i style="float:right;">Last updated - July </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 2 additions & 1 deletion doc/modules/colorizer.parser.names.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ <h2>Modules</h2>
<li><strong>parser.names</strong></li>
<li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
<li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
<li><a href="../modules/colorizer.sass.html">sass</a></li>
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
<li><a href="../modules/trie.html">trie</a></li>
Expand Down Expand Up @@ -181,7 +182,7 @@ <h3>Returns:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated - January </i>
<i style="float:right;">Last updated - July </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 2 additions & 1 deletion doc/modules/colorizer.parser.rgb.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ <h2>Modules</h2>
<li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
<li><strong>parser.rgb</strong></li>
<li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
<li><a href="../modules/colorizer.sass.html">sass</a></li>
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
<li><a href="../modules/trie.html">trie</a></li>
Expand Down Expand Up @@ -126,7 +127,7 @@ <h3>Returns:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated - January </i>
<i style="float:right;">Last updated - July </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 2 additions & 1 deletion doc/modules/colorizer.parser.rgb_hex.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ <h2>Modules</h2>
<li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
<li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
<li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
<li><a href="../modules/colorizer.sass.html">sass</a></li>
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
<li><a href="../modules/trie.html">trie</a></li>
Expand Down Expand Up @@ -123,7 +124,7 @@ <h3>Returns:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated - January </i>
<i style="float:right;">Last updated - July </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 2 additions & 1 deletion doc/modules/colorizer.parser.rgba_hex.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ <h2>Modules</h2>
<li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
<li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
<li><strong>parser.rgba_hex</strong></li>
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
<li><a href="../modules/colorizer.sass.html">sass</a></li>
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
<li><a href="../modules/trie.html">trie</a></li>
Expand Down Expand Up @@ -128,7 +129,7 @@ <h3>Returns:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated - January </i>
<i style="float:right;">Last updated - July </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
Loading