| 1 | package Role::TinyCommons::TermAttr::Color; | ||||||||||||
| 2 | |||||||||||||
| 3 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |||||||||||
| 4 | 1 | our $DATE = '2020-06-06'; # DATE | |||||||||||
| 5 | 1 | our $DIST = 'Role-TinyCommons-TermAttr-Color'; # DIST | |||||||||||
| 6 | 1 | our $VERSION = '0.002'; # VERSION | |||||||||||
| 7 | |||||||||||||
| 8 | 1 | ▶ | use Role::Tiny; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | 0 | ▶ | sub termattr_use_color { | ||||||||||
|
Subroutine
termattr_use_color: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||
| 11 | 0 | require Term::App::Util::Color; | |||||||||||
| 12 | |||||||||||||
| 13 | 0 | my $self = shift; | |||||||||||
| 14 | |||||||||||||
| 15 | 0 | my $res = Term::App::Util::Color::term_app_should_use_color(); | |||||||||||
| 16 | 0 | ▶ | $self->{_termattr_debug_info} //= {}; | ||||||||||
|
Condition0%0/2
$self->{"_termattr_debug_info"} //= {}
MC/DC0%0/1
$self->{"_termattr_debug_info"} //= {}
$self->{"_termattr_debug_info"}
Truth table0%0/2
A
A= $self->{"_termattr_debug_info"}
| |||||||||||||
| 17 | $self->{_termattr_debug_info}{$_} = $res->[3]{'func.debug_info'}{$_} | ||||||||||||
| 18 | 0 | for keys %{ $res->[3]{'func.debug_info'} }; | |||||||||||
| 19 | 0 | $res->[2]; | |||||||||||
| 20 | } | ||||||||||||
| 21 | |||||||||||||
| 22 | 0 | ▶ | sub termattr_color_depth { | ||||||||||
|
Subroutine
termattr_color_depth: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||
| 23 | 0 | require Term::App::Util::Color; | |||||||||||
| 24 | |||||||||||||
| 25 | 0 | my $self = shift; | |||||||||||
| 26 | |||||||||||||
| 27 | 0 | my $res = Term::App::Util::Color::term_app_color_depth(); | |||||||||||
| 28 | 0 | ▶ | $self->{_termattr_debug_info} //= {}; | ||||||||||
|
Condition0%0/2
$self->{"_termattr_debug_info"} //= {}
MC/DC0%0/1
$self->{"_termattr_debug_info"} //= {}
$self->{"_termattr_debug_info"}
Truth table0%0/2
A
A= $self->{"_termattr_debug_info"}
| |||||||||||||
| 29 | $self->{_termattr_debug_info}{$_} = $res->[3]{'func.debug_info'}{$_} | ||||||||||||
| 30 | 0 | for keys %{ $res->[3]{'func.debug_info'} }; | |||||||||||
| 31 | 0 | $res->[2]; | |||||||||||
| 32 | } | ||||||||||||
| 33 | |||||||||||||
| 34 | 1 | 1; | |||||||||||
| 35 | # ABSTRACT: Determine color depth and whether to use color or not | ||||||||||||
| 36 | |||||||||||||
| 37 | __END__ | ||||||||||||