NAME
Data::URIID::Colour - Extractor for identifiers from URIs
VERSION
version v0.17
SYNOPSIS
use Data::URIID::Colour;
my $colour = Data::URIID::Colour->new(rgb => '#FF0000');
This module represents a single colour.
This package inherits from Data::URIID::Base, and Data::Identifier::Interface::Known (experimental).
METHODS
new
my $colour = Data::URIID::Colour->new( option => value, ... );
Returns a new object for the given colour. The following options are defined:
rgb
-
The RGB value in hex notation. E.g.
#FF0000
. extractor
-
optionally, an instance of Data::URIID.
from
-
optionally, an instance of any colour provider. The provider might be used to fill defaults for the other options (such as
rgb
orextractor
).Currently the value must be one of Data::URIID::Colour, Data::URIID::Result, or Data::Identifier (only supported for some objects, including those generated with "colour" in Data::Identifier::Generate). But other types might also be supported.
If using Data::URIID::Result this might not be what you want. See also "displaycolour" in Data::URIID::Result.
rgb
my $rgb = $colour->rgb;
Returns the colour in six digit hex notation with prepended pound (#
) if successful or die
otherwise. The returned value is suitable for use in CSS.
known
my @list = Data::URIID::Colour->known($class [, %opts ]);
# or:
my @list = $colour->known($class [, %opts ]);
(experimental, since v0.17)
Returns the list of known objects for the given $class
. Currently no specific classes are supported, so the only valid value is :all
. See "known" in Data::Identifier::Interface::Known for details.
If called on a instance of this package extractor
is filled in automatically if one is known by this instance.
Note: This is an experimental feature! It may be removed or altered at any future version!
AUTHOR
Löwenfelsen UG (haftungsbeschränkt) <support@loewenfelsen.net>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2023-2025 by Löwenfelsen UG (haftungsbeschränkt) <support@loewenfelsen.net>.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)