lib/LaTeXML/Common/Color/gray.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 37 CC 1 SCAR 6.9
CC
1
Cov
0%
gray
2.0
rgb
2.0
cmy
2.0
CRAP 2.0
1 # /=====================================================================\ #
2 # | LaTeXML::Common::Color::gray | #
3 # | A representation of colors in the gray color model | #
4 # |=====================================================================| #
5 # | Part of LaTeXML: | #
6 # | Public domain software, produced as part of work done by the | #
7 # | United States Government & not subject to copyright in the US. | #
8 # |---------------------------------------------------------------------| #
9 # | Bruce Miller <bruce.miller@nist.gov> #_# | #
10 # | http://dlmf.nist.gov/LaTeXML/ (o o) | #
11 # \=========================================================ooo==U==ooo=/ #
12 package LaTeXML::Common::Color::gray;
13 use strict;
14 use warnings;
15 use base qw(LaTeXML::Common::Color);
16 use LaTeXML::Global;
17  
18 sub gray {
19 my ($self) = @_;
20 return $self; }
21  
22 sub rgb {
23 my ($self) = @_;
24 return LaTeXML::Common::Color->new('rgb', $$self[1], $$self[1], $$self[1]); }
25  
26 sub cmy {
27 my ($self) = @_;
28 return LaTeXML::Common::Color->new('cmy', 1 - $$self[1], 1 - $$self[1], 1 - $$self[1]); }
29  
30 sub cmyk {
31 my ($self) = @_;
32 return LaTeXML::Common::Color->new('cmy', 0, 0, 0, 1 - $$self[1]); }
33  
34 sub hsb {
35 my ($self) = @_;
36 return LaTeXML::Common::Color->new('hsb', 0, 0, $$self[1]); }
37  
38 #======================================================================
39 1;
40  
41 __END__