Author image Robert Drake
and 1 contributors

name

App::Tel::Color::Base - parent stub and examples for Color modules

METHODS

new

    my $colorobject = new App::Tel::Base;

Initializes a new color object.

colorize

    my $output = $colorobject->colorize('text');

Normally this will consume text from an input buffer and have some logic that determines how it will color the output. This method is designed to be overridden in all child modules.

parse

    $colorobject->parse($buffer, $callback);

Breaks a string up into substrings by line. It then calls colorize with the substring.

get_colors

    my @colors = $self->get_colors();
    my $color = $self->get_colors(1);

Returns a list of available colors by their names. This list excludes the RED color because it's used for errors and these colors are specifically for the rainbow code that doesn't use red.

If given a value, it returns $color[value].