File Coverage

blib/lib/ColorTheme/Data/Dump/Color/Default16.pm
Criterion Covered Total %
statement 11 11 100.0
branch 3 4 75.0
condition n/a
subroutine 4 4 100.0
pod n/a
total 18 19 94.7


line stmt bran cond sub pod time code
1             package ColorTheme::Data::Dump::Color::Default16;
2              
3 1     1   265685 use strict;
  1         2  
  1         37  
4 1     1   4 use parent 'ColorThemeBase::Static::FromStructColors';
  1         1  
  1         11  
5 1     1   2832 use Term::ANSIColor;
  1         10332  
  1         335  
6              
7             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
8             our $DATE = '2025-02-21'; # DATE
9             our $DIST = 'Data-Dump-Color'; # DIST
10             our $VERSION = '0.251'; # VERSION
11              
12             sub _ansi16 {
13 12     12   208 my ($fg, $bg) = @_;
14             return {
15 12 50       25 (defined $fg ? (ansi_fg=>color($fg)) : ()),
    100          
16             (defined $bg ? (ansi_bg=>color($bg)) : ()),
17             };
18             }
19              
20             our %THEME = (
21             v => 2,
22             items => {
23             Regexp => _ansi16('yellow'),
24             undef => _ansi16('bright_red'),
25             number => _ansi16('bright_blue'), # floats can have different color
26             float => _ansi16('cyan'),
27             string => _ansi16('bright_yellow'),
28             object => _ansi16('bright_green'),
29             glob => _ansi16('bright_cyan'),
30             key => _ansi16('magenta'),
31             comment => _ansi16('green'),
32             keyword => _ansi16('blue'),
33             symbol => _ansi16('cyan'),
34             linum => _ansi16('black', 'on_white'), # file:line number
35             },
36             );
37              
38             #use Data::Dump; dd \%THEME;
39              
40             1;
41             # ABSTRACT: Default color theme for Data::Dump::Color (16 color)
42              
43             __END__