File Coverage

blib/lib/Data/Printer/Theme/Material.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::Material;
2             # inspired by Mattia Astorino's Material theme:
3             # https://github.com/material-theme/vsc-material-theme
4 32     32   272 use strict;
  32         67  
  32         1461  
5 32     32   164 use warnings;
  32         55  
  32         9394  
6              
7             sub colors {
8 267     267 0 2800 my %code_for = (
9             'very_light_gray' => '#EEFFFF',
10             'light_gray' => '#A1BBC5',
11             'gray' => '#4f5a61',
12             'green' => '#90B55A', #'#C3E88D',
13             'teal' => '#009688',
14             'light_teal' => '#73d1c8',
15             'cyan' => '#66D9EF',
16             'blue' => '#82AAFF',
17             'indigo' => '#7986CB',
18             'purple' => '#C792EA',
19             'pink' => '#FF5370',
20             'red' => '#F07178',
21             'strong_orange' => '#F78C6A',
22             'orange' => '#FFCB6B',
23             'light_orange' => '#FFE082',
24             );
25              
26             return {
27             array => $code_for{light_gray}, # array index numbers
28             number => $code_for{strong_orange}, # numbers
29             string => $code_for{green}, # (or 'very_light_gray'?) # strings
30             class => $code_for{purple}, # class names
31             method => $code_for{blue}, # method names
32             undef => $code_for{pink}, # the 'undef' value
33             hash => $code_for{indigo}, # hash keys
34             regex => $code_for{orange}, # regular expressions
35             code => $code_for{gray}, # code references
36             glob => $code_for{strong_orange}, # globs (usually file handles)
37             vstring => $code_for{strong_orange}, # version strings (v5.16.0, etc)
38             lvalue => $code_for{strong_orange}, # lvalue label
39             format => $code_for{strong_orange}, # format type
40             true => $code_for{blue}, # boolean type (true)
41             false => $code_for{blue}, # boolean type (false)
42             repeated => $code_for{red}, # references to seen values
43             caller_info => $code_for{gray}, # details on what's being printed
44             weak => $code_for{green}, # weak references flag
45             tainted => $code_for{light_orange}, # tainted flag
46             unicode => $code_for{light_orange}, # utf8 flag
47             escaped => $code_for{teal}, # escaped characters (\t, \n, etc)
48             brackets => $code_for{cyan}, # (), {}, []
49             separator => $code_for{cyan}, # the "," between hash pairs, array elements, etc
50             quotes => $code_for{cyan},
51             unknown => $code_for{red}, # any (potential) data type unknown to Data::Printer
52 267         5641 };
53             }
54              
55             1;
56             __END__
57              
58             =head1 NAME
59              
60             Data::Printer::Theme::Material - Material theme for DDP
61              
62             =head1 SYNOPSIS
63              
64             In your C<.dataprinter> file:
65              
66             theme = Material
67              
68             Or during runtime:
69              
70             use DDP theme => 'Material';
71              
72             =head1 DESCRIPTION
73              
74             This module implements the Material theme for Data::Printer, inspired by
75             L<Mattia Astorino's original work|https://github.com/equinusocio/vsc-material-theme>.
76              
77             =for html <a href="https://metacpan.org/pod/Data::Printer::Theme::Material"><img src="https://raw.githubusercontent.com/garu/Data-Printer/master/examples/theme-material.png" alt="Material Theme" /></a>
78              
79             =head1 SEE ALSO
80              
81             L<Data::Printer>
82              
83             L<Data::Printer::Theme>