Skip to content

Commit ed6018d

Browse files
Add support for "brightred"
1 parent 433b856 commit ed6018d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

diff-so-fancy

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,12 @@ sub git_ansi_color {
936936
push(@ansi_part, "38;5;$fg");
937937
# It's a simple 16 color OG ansi
938938
} elsif ($fg) {
939-
push(@ansi_part, $colors->{$fg} + 30);
939+
my $bright = $fg =~ s/bright//;
940+
my $color_num = $colors->{$fg} + 30;
941+
942+
if ($bright) { $color_num += 8; }
943+
944+
push(@ansi_part, $color_num);
940945
}
941946

942947
#############################################
@@ -949,7 +954,12 @@ sub git_ansi_color {
949954
push(@ansi_part, 7);
950955
# It's a simple 16 color OG ansi
951956
} elsif ($bg) {
952-
push(@ansi_part, $colors->{$fg} + 40);
957+
my $bright = $bg =~ s/bright//;
958+
my $color_num = $colors->{$bg} + 30;
959+
960+
if ($bright) { $color_num += 8; }
961+
962+
push(@ansi_part, $color_num);
953963
}
954964

955965
#############################################

0 commit comments

Comments
 (0)