NAME
Convert::Color::HTML
- color conversion using Color::Library::Dictionary::HTML
SYNOPSIS
Directly:
use
Convert::Color::HTML;
my
$red
= Convert::Color::HTML->new(
'red'
);
my
$blue
= Convert::Color::HTML->new(
'#0000FF'
);
Via Convert::Color:
use
Convert::Color;
my
$cyan
= Convert::Color->new(
'html:cyan'
);
Conversion from RGB:
my
$green
= Convert::Color::RGB->( 0, 1.0, 0 )->as_html;
say
"HTML colour name is "
.
$green
->name;
DESCRIPTION
This subclass of Convert::Color::Library provides a shortcut to performing library lookups specifically within the HTML
dictionary. Additionally it will parse #RRGGBB
color specifications.
CONSTRUCTOR
$color = Convert::Color::HTML->new( $name )
Returns a new object to represent the named color from the HTML
dictionary or plain RGB triplet.
METHODS
$name = $color->name
Returns the name of the color instance; either the HTML
dictionary name, or the plain RGB triplet notation, as was passed to the constructor.
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>