| Color-Palette documentation | Contained in the Color-Palette distribution. |
Color::Palette::Schema - requirements for a palette
version 0.091400
Most of this is documented in Color::Palette. Below is just a bit more documentation.
This is an arrayref of color names that must be present in any palette checked against this schema.
$schema->check($palette);
This method will throw an exception if the given palette doesn't meet the requirements of the schema.
Ricardo SIGNES <rjbs@cpan.org>
This software is copyright (c) 2009 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under the same terms as perl itself.
| Color-Palette documentation | Contained in the Color-Palette distribution. |
package Color::Palette::Schema; our $VERSION = '0.091400'; use Moose; # ABSTRACT: requirements for a palette use Color::Palette; use Color::Palette::Types qw(ColorName); use MooseX::Types::Moose qw(ArrayRef); has required_colors => ( is => 'ro', isa => ArrayRef[ ColorName ], required => 1, ); sub check { my ($self, $palette) = @_; # ->color will throw an exception on unknown colors, doing our job for us. # -- rjbs, 2009-05-19 $palette->color($_) for @{ $self->required_colors }; } 1; __END__