Module colorizer.parser.names

This module provides a parser that identifies named colors from a given line of text.

It supports standard color names and optional Tailwind CSS color names. The module uses a Trie structure for efficient matching of color names in text.

Functions

parser (line, i, opts) Parses a line to identify color names.
reset_cache () Resets the color names cache.


Functions

parser (line, i, opts)
Parses a line to identify color names.

Parameters:

  • line string The text line to parse.
  • i number The index to start parsing from.
  • opts table Parsing options.

Returns:

    number|nil, string|nil Length of match and hex value if found.
reset_cache ()
Resets the color names cache. Called from colorizer.setup
generated by LDoc 1.5.0 Last updated - December