Commit | Line | Data |
---|---|---|
ddcfafb2 MG |
1 | #!/usr/bin/perl |
2 | use 5.008009; | |
3 | use strict; | |
4 | use warnings; | |
5 | ||
6 | use Convert::Color; | |
7 | use Test::More tests => 16; | |
8 | ||
9 | my @tests = ( | |
10 | [qw/husl H S L hsl/], | |
11 | [qw/lch L C h lch/], | |
12 | [qw/luv L u v luv/], | |
13 | [qw/xyz X Y Z xyz/], | |
14 | ); | |
15 | ||
16 | for (@tests) { | |
17 | my ($name, $x, $y, $z, $xyz) = @$_; | |
18 | my $col = Convert::Color->new("$name:1,2,3"); | |
19 | is $col->$x, 1, "\$$name->$x"; | |
20 | is $col->$y, 2, "\$$name->$y"; | |
21 | is $col->$z, 3, "\$$name->$z"; | |
22 | is_deeply [$col->$xyz], [1, 2, 3], "\$$name->$xyz" | |
23 | } |