| 1 | package Catppuccin; | ||||||||||||||||||||
| 2 | 1 | $Catppuccin::VERSION = '0.002'; | |||||||||||||||||||
| 3 | # ABSTRACT: Soothing pastel theme for the high-spirited! | ||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 1 | ▶ | use Catppuccin::Data; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 1 | ▶ | BEGIN { | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=7.1
| |||||||||||||||||||||
| 11 | 1 | my @flavors; | |||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 1 | for my $flavor (Catppuccin::Data->flavors) { | |||||||||||||||||||
| 14 | 4 | push @flavors, $flavor->id; | |||||||||||||||||||
| 15 | 1 | ▶ | no strict 'refs'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 4 | ▶ | *{'Catppuccin::'.$flavor->id} = sub { | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=2.6
| |||||||||||||||||||||
| 17 | 0 | bless \do { $flavor }, 'Catppuccin::Flavor'; | |||||||||||||||||||
| 18 | } | ||||||||||||||||||||
| 19 | 4 | } | |||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 0 | ▶ | sub flavors { @flavors }; | ||||||||||||||||||
|
Subroutine
flavors: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | package # hide from PAUSE | ||||||||||||||||||||
| 25 | Catppuccin::Flavor; | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | 0 | ▶ | sub hex { | ||||||||||||||||||
|
Subroutine
hex: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 28 | 0 | bless [${shift @_}, 'hex'], 'Catppuccin::Palette::Color'; | |||||||||||||||||||
| 29 | } | ||||||||||||||||||||
| 30 | 0 | ▶ | sub rgb { | ||||||||||||||||||
|
Subroutine
rgb: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 31 | 0 | bless [${shift @_}, 'rgb'], 'Catppuccin::Palette::Color'; | |||||||||||||||||||
| 32 | } | ||||||||||||||||||||
| 33 | 0 | ▶ | sub hsl { | ||||||||||||||||||
|
Subroutine
hsl: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 34 | 0 | bless [${shift @_}, 'hsl'], 'Catppuccin::Palette::Color'; | |||||||||||||||||||
| 35 | } | ||||||||||||||||||||
| 36 | 0 | ▶ | sub oklch { | ||||||||||||||||||
|
Subroutine
oklch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 37 | 0 | bless [${shift @_}, 'oklch'], 'Catppuccin::Palette::Color'; | |||||||||||||||||||
| 38 | } | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 0 | ▶ | sub term_rgb { | ||||||||||||||||||
|
Subroutine
term_rgb: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 41 | 0 | ▶ | bless [${shift @_}, sub { | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 42 | 0 | sprintf 'rgb%u%u%u', map { $_ % 6 } shift->rgb | |||||||||||||||||||
| 43 | 0 | }], 'Catppuccin::Palette::Color'; | |||||||||||||||||||
| 44 | } | ||||||||||||||||||||
| 45 | 0 | ▶ | sub term_truecolor { | ||||||||||||||||||
|
Subroutine
term_truecolor: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 46 | 0 | ▶ | bless [${shift @_}, sub { | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 47 | 0 | sprintf 'r%ug%ub%u', shift->rgb | |||||||||||||||||||
| 48 | 0 | }], 'Catppuccin::Palette::Color'; | |||||||||||||||||||
| 49 | } | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | 0 | ▶ | sub term { | ||||||||||||||||||
|
Subroutine
term: not called CC=3 SCAR=24.8
| |||||||||||||||||||||
| 52 | 0 | ▶ | ($ENV{COLORTERM} // '') eq 'truecolor' ? | ||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$ENV{"COLORTERM"} // ""
MC/DC0%0/1
$ENV{"COLORTERM"} // ""
$ENV{"COLORTERM"}
Truth table0%0/2
A
A= $ENV{"COLORTERM"}
| |||||||||||||||||||||
| 53 | shift->term_truecolor : shift->term_rgb | ||||||||||||||||||||
| 54 | } | ||||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | package # hide from PAUSE | ||||||||||||||||||||
| 57 | Catppuccin::Palette::Color; | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | 0 | ▶ | sub AUTOLOAD { | ||||||||||||||||||
|
Subroutine
AUTOLOAD: not called CC=2 SCAR=17.9
| |||||||||||||||||||||
| 60 | 0 | our $AUTOLOAD; | |||||||||||||||||||
| 61 | 0 | my ($color) = $AUTOLOAD =~ m/::([^:]+)$/; | |||||||||||||||||||
| 62 | 0 | my ($class, $format) = @{shift @_}; | |||||||||||||||||||
| 63 | 0 | ▶ | ref $format ? $format->($class->color->$color) : $class->color->$color->$format; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 64 | } | ||||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | 0 | ▶ | sub id { shift->[0]->id } | ||||||||||||||||||
|
Subroutine
id: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 67 | |||||||||||||||||||||
| 68 | 0 | ▶ | sub colors { | ||||||||||||||||||
|
Subroutine
colors: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 69 | 0 | map { $_->id } shift->[0]->colors; | |||||||||||||||||||
| 70 | } | ||||||||||||||||||||
| 71 | |||||||||||||||||||||
| 72 | 0 | ▶ | sub DESTROY {} | ||||||||||||||||||
|
Subroutine
DESTROY: not called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 73 | |||||||||||||||||||||
| 74 | 1 | 1; | |||||||||||||||||||
| 75 | __END__ | ||||||||||||||||||||