| 1 | package ColorThemeBase::Static::FromObjectColors; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict 'subs', 'vars'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | #use warnings; | ||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use parent 'ColorThemeBase::Base'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |||||||||
| 9 | 1 | our $DATE = '2024-07-17'; # DATE | |||||||||
| 10 | 1 | our $DIST = 'ColorThemeBase-Static'; # DIST | |||||||||
| 11 | 1 | our $VERSION = '0.009'; # VERSION | |||||||||
| 12 | |||||||||||
| 13 | 0 | ▶ | sub list_items { | ||||||||
|
Subroutine
list_items: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 14 | 0 | my $self = shift; | |||||||||
| 15 | 0 | my @list = sort keys %{ $self->{items} }; | |||||||||
| 16 | 0 | ▶ | wantarray ? @list : \@list; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | 0 | ▶ | sub get_item_color { | ||||||||
|
Subroutine
get_item_color: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||
| 20 | 0 | my ($self, $name, $args) = @_; | |||||||||
| 21 | |||||||||||
| 22 | 0 | my $c = $self->{items}{$name}; | |||||||||
| 23 | 0 | ▶ | return unless defined $c; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | if (ref $c eq 'CODE') { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 0 | my $c2 = $c->($self, $name, $args); | |||||||||
| 27 | 0 | ▶ | if (ref $c2 eq 'CODE') { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | 0 | die "Color '$name' of theme $self->{orig_class} returns coderef, ". | |||||||||
| 29 | "which after called still returns a coderef"; | ||||||||||
| 30 | } | ||||||||||
| 31 | 0 | return $c2; | |||||||||
| 32 | } | ||||||||||
| 33 | 0 | $c; | |||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 1 | 1; | |||||||||
| 37 | # ABSTRACT: Base class for color theme modules with static list of items (from object's items key) | ||||||||||
| 38 | |||||||||||
| 39 | __END__ | ||||||||||