File Coverage

blib/lib/Data/Printer/Theme/Solarized.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::Solarized;
2             # inspired by Ethan Schoonover's Solarized theme:
3             # http://ethanschoonover.com/solarized
4 1     1   5 use strict;
  1         1  
  1         26  
5 1     1   2 use warnings;
  1         1  
  1         180  
6              
7             sub colors {
8 1     1 0 14 my %code_for = (
9             base03 => '#1c1c1c', # '#002b36'
10             base02 => '#262626', # '#073642'
11             base01 => '#585858', # '#586e75'
12             base00 => '#626262', # '#657b83'
13             base0 => '#808080', # '#839496'
14             base1 => '#8a8a8a', # '#93a1a1'
15             base2 => '#e4e4e4', # '#eee8d5'
16             base3 => '#ffffd7', # '#fdf6e3'
17             yellow => '#af8700', # '#b58900'
18             orange => '#d75f00', # '#cb4b16'
19             red => '#d70000', # '#dc322f'
20             magenta => '#af005f', # '#d33682'
21             violet => '#5f5faf', # '#6c71c4'
22             blue => '#0087ff', # '#268bd2'
23             cyan => '#00afaf', # '#2aa198'
24             green => '#5f8700', # '#859900'
25             );
26              
27             return {
28             array => $code_for{violet}, # array index numbers
29             number => $code_for{cyan}, # numbers
30             string => $code_for{cyan}, # strings
31             class => $code_for{yellow}, # class names
32             method => $code_for{orange}, # method names
33             undef => $code_for{red}, # the 'undef' value
34             hash => $code_for{green}, # hash keys
35             regex => $code_for{orange}, # regular expressions
36             code => $code_for{base2}, # code references
37             glob => $code_for{blue}, # globs (usually file handles)
38             vstring => $code_for{base1}, # version strings (v5.16.0, etc)
39             lvalue => $code_for{green}, # lvalue label
40             format => $code_for{green}, # format type
41             true => $code_for{blue}, # boolean type (true)
42             false => $code_for{blue}, # boolean type (false)
43             repeated => $code_for{red}, # references to seen values
44             caller_info => $code_for{cyan}, # details on what's being printed
45             weak => $code_for{violet}, # weak references flag
46             tainted => $code_for{violet}, # tainted flag
47             unicode => $code_for{magenta}, # utf8 flag
48             escaped => $code_for{red}, # escaped characters (\t, \n, etc)
49             brackets => $code_for{base0}, # (), {}, []
50             separator => $code_for{base0}, # the "," between hash pairs, array elements, etc
51             quotes => $code_for{'base0'},
52             unknown => $code_for{red}, # any (potential) data type unknown to Data::Printer
53 1         18 };
54              
55             }
56              
57             1;
58             __END__
59              
60             =head1 NAME
61              
62             Data::Printer::Theme::Solarized - Solarized theme for DDP
63              
64             =head1 SYNOPSIS
65              
66             In your C<.dataprinter> file:
67              
68             theme = Solarized
69              
70             Or during runtime:
71              
72             use DDP theme => 'Solarized';
73              
74             =head1 DESCRIPTION
75              
76             This module implements the Solarized theme for Data::Printer, inspired by
77             L<Ethan Schoonover's original work|http://ethanschoonover.com/solarized>
78              
79              
80             =for html <a href="https://metacpan.org/pod/Data::Printer::Theme::Solarized"><img src="https://raw.githubusercontent.com/garu/Data-Printer/master/examples/theme-solarized.png" alt="Solarized Theme" /></a>
81              
82             =head1 SEE ALSO
83              
84             L<Data::Printer>
85              
86             L<Data::Printer::Theme>