1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
# /=====================================================================\ #
# | LaTeXML::Common::Color::gray | #
# | A representation of colors in the gray color model | #
# |=====================================================================| #
# | Part of LaTeXML: | #
# | Public domain software, produced as part of work done by the | #
# | United States Government & not subject to copyright in the US. | #
# |---------------------------------------------------------------------| #
# | Bruce Miller <bruce.miller@nist.gov> #_# | #
# | http://dlmf.nist.gov/LaTeXML/ (o o) | #
# \=========================================================ooo==U==ooo=/ #
package LaTeXML::Common::Color::gray;
use strict;
use warnings;
use base qw(LaTeXML::Common::Color);
use LaTeXML::Global;
sub gray {
my ($self) = @_;
return $self; }
sub rgb {
my ($self) = @_;
return LaTeXML::Common::Color->new('rgb', $$self[1], $$self[1], $$self[1]); }
sub cmy {
my ($self) = @_;
return LaTeXML::Common::Color->new('cmy', 1 - $$self[1], 1 - $$self[1], 1 - $$self[1]); }
sub cmyk {
my ($self) = @_;
return LaTeXML::Common::Color->new('cmy', 0, 0, 0, 1 - $$self[1]); }
sub hsb {
my ($self) = @_;
return LaTeXML::Common::Color->new('hsb', 0, 0, $$self[1]); }
#======================================================================
1;
__END__
=head1 NAME
C<LaTeXML::Common::Color::gray> - represents colors in the gray color model:
gray value in [0..1];
extends L<LaTeXML::Common::Color>.
=head1 AUTHOR
Bruce Miller <bruce.miller@nist.gov>
=head1 COPYRIGHT
Public domain software, produced as part of work done by the
United States Government & not subject to copyright in the US.
=cut
|