@@ -551,6 +551,7 @@ user_default_options *colorizer.config.user_default_options*
551
551
hooks - table: Table of hook functions
552
552
{disable_line_highlight} - function: Returns boolean which controls if
553
553
line should be parsed for highlights
554
+ {xterm} - boolean: Enables xterm 256-color codes (#xNN, \e[38;5;NNNm)
554
555
555
556
556
557
@@ -1010,6 +1011,46 @@ parser({line}, {i}, {opts}) *colorizer.parser.rgb.parser*
1010
1011
1011
1012
1012
1013
1014
+ ==============================================================================
1015
+ XTERM *colorizer.parser.xterm-introduction*
1016
+
1017
+ This module provides a parser for identifying and converting xterm color codes
1018
+ to RGB hexadecimal format.
1019
+
1020
+ It supports both #xNN format (decimal, 0-255) and ANSI escape sequences
1021
+ \e[38;5;NNNm for xterm 256-color palette.
1022
+ The function reads the color code and returns the corresponding RGB hex string
1023
+ from the xterm color palette.
1024
+
1025
+ ==============================================================================
1026
+ LUA API *colorizer.parser.xterm-lua-api*
1027
+
1028
+ Functions: ~
1029
+ | parser | - Parses xterm color codes and converts them to RGB hex format.
1030
+
1031
+
1032
+ parser({line} , {i} ) *colorizer.parser.xterm.parser*
1033
+ Parses xterm color codes and converts them to RGB hex format.
1034
+
1035
+ This function matches both #xNN format (decimal, 0-255) and ANSI escape
1036
+ sequences \e[38;5;NNNm
1037
+ for xterm 256-color palette. It returns the corresponding RGB hex string
1038
+ from the xterm color palette.
1039
+
1040
+
1041
+ Parameters: ~
1042
+ {line} - string: The line of text to parse for xterm color codes
1043
+ {i} - number: The starting index within the line where parsing should
1044
+ begin
1045
+
1046
+ returns:~
1047
+ number or nil: The end index of the parsed xterm color code within the
1048
+ line, or `nil` if parsing failed
1049
+ string or nil: The RGB hexadecimal color from the xterm palette, or
1050
+ `nil` if parsing failed
1051
+
1052
+
1053
+
1013
1054
==============================================================================
1014
1055
SASS *colorizer.sass-introduction*
1015
1056
0 commit comments