NAME

Convert::Color::XYZ - a color value in the CIE 1931 XYZ color space

SYNOPSIS

use Convert::Color::XYZ;
my $red = Convert::Color::XYZ->new(0.41239, 0.21264, 0.01933);
my $green = Convert::Color::XYZ->new('0.35758,0.71517,0.11919');

use Convert::Color;
my $blue = Convert::Color->new('xyz:0.18048,0.07219,0.95053');

say $red->X; # 0.41239
say $red->Y; # 0.21264
say $red->Z; # 0.01933
say join ',', $blue->xyz; # 0.18048,0.07219,0.95053

DESCRIPTION

Objects of this class represent colors in the CIE 1931 XYZ color space.

Methods:

Convert::Color::XYZ->new($x, $y, $z)

Construct a color from its components.

Convert::Color::XYZ->new("$x,$y,$z")

Construct a color from a string. The string should contain the three components, separated by commas.

$xyz->X
$xyz->Y
$xyz->Z

Accessors for the three components of the color.

$xyz->xyz

Returns the three components as a list.

SEE ALSO

Convert::Color

AUTHOR

Marius Gavrilescu, <marius@ieval.ro>

COPYRIGHT AND LICENSE

Copyright (C) 2015-2017 by Marius Gavrilescu

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.20.2 or, at your option, any later version of Perl 5 you may have available.