Skip to content

[Feature request] Support user defined color patterns #93

@pelegs

Description

@pelegs

Could look something like this:

require 'colorizer'.setup {
  '*';
  user_patterns = {
    'LaTeXHTML' = {
        'type' = 'RRGGBB',
        'pattern' = '\\{HTML\\}\\{([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})\\}',
    },
  }
}

In the above example we add a list of user-defined patterns. Each pattern gets a name (in this case there's only one, namely "LaTeXHTML") and a regex to match, where the specification for the regex is given by the type (e.g. RBG, RRGGBB, RRGGBBAAm etc.).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions