File Coverage

blib/lib/Data/Printer/Theme/Monokai.pm
Criterion Covered Total %
statement 8 8 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod 0 1 0.0
total 11 12 91.6


line stmt bran cond sub pod time code
1             package Data::Printer::Theme::Monokai;
2             # inspired by Wimer Hazenberg's Monokai theme: monokai.nl
3 2     2   13 use strict;
  2         3  
  2         71  
4 2     2   9 use warnings;
  2         3  
  2         490  
5              
6             sub colors {
7 3     3 0 120 my %code_for = (
8             grey => '#75715E',
9             yellow => '#E6DB74',
10             violet => '#AE81FF',
11             pink => '#F92672',
12             cyan => '#66D9EF',
13             green => '#A6E22E',
14             orange => '#FD971F',
15             empty => '',
16             );
17             return {
18             array => $code_for{orange}, # array index numbers
19             number => $code_for{violet}, # numbers
20             string => $code_for{yellow}, # (or 'very_light_gray'?) # strings
21             class => $code_for{green}, # class names
22             method => $code_for{green}, # method names
23             undef => $code_for{pink}, # the 'undef' value
24             hash => $code_for{cyan}, # hash keys
25             regex => $code_for{green}, # regular expressions
26             code => $code_for{orange}, # code references
27             glob => $code_for{violet}, # globs (usually file handles)
28             vstring => $code_for{cyan}, # version strings (v5.16.0, etc)
29             lvalue => $code_for{green}, # lvalue label
30             format => $code_for{violet}, # format type
31             true => $code_for{violet}, # boolean type (true)
32             false => $code_for{violet}, # boolean type (false)
33             repeated => $code_for{pink}, # references to seen values
34             caller_info => $code_for{grey}, # details on what's being printed
35             weak => $code_for{green}, # weak references flag
36             tainted => $code_for{green}, # tainted flag
37             unicode => $code_for{green}, # utf8 flag
38             escaped => $code_for{pink}, # escaped characters (\t, \n, etc)
39             brackets => $code_for{empty}, # (), {}, []
40             separator => $code_for{empty}, # the "," between hash pairs, array elements, etc
41             quotes => $code_for{yellow},
42             unknown => $code_for{pink}, # any (potential) data type unknown to Data::Printer
43 3         57 };
44             }
45              
46             1;
47             __END__
48              
49             =head1 NAME
50              
51             Data::Printer::Theme::Monokai - Monokai theme for DDP
52              
53             =head1 SYNOPSIS
54              
55             In your C<.dataprinter> file:
56              
57             theme = Monokai
58              
59             Or during runtime:
60              
61             use DDP theme => 'Monokai';
62              
63             =head1 DESCRIPTION
64              
65             This module implements the Monokai theme for Data::Printer, inspired by
66             L<Wimer Hazenberg's original work|https://monokai.nl>.
67              
68             =for html <a href="https://metacpan.org/pod/Data::Printer::Theme::Monokai"><img src="https://raw.githubusercontent.com/garu/Data-Printer/master/examples/theme-monokai.png" alt="Monokai Theme" /></a>
69              
70              
71             =head1 SEE ALSO
72              
73             L<Data::Printer>
74              
75             L<Data::Printer::Theme>