use Test::More;

use Colouring::In::XS qw/desaturate/;

# tests
convert_colour(
	colour => 'rgb(0, 120, 120)',
	expected => ['29|30', '89|90', '89|90'],
	amount => 50
);
convert_colour(
	colour => 'rgb(0, 120, 120)',
	expected => ['59|60', '59|60', '59|60'],
	amount => 100
);

sub convert_colour {
	my %args = @_;
	
	my $colour = desaturate($args{colour}, $args{amount});

	my @c = $colour->colour;	
	for (my $i = 0; $i < @c; $i++) {
		like($c[$i], qr/$args{expected}[$i]/, 'expected colour!');
	}
}

done_testing();

1;
