- greys => [map {"38;5;$_"} 52, 235..255, 47],
- }->{$_[1]} // [ split /[^0-9;]/, $_[1] ];
+ greys => [map {"38;5;$_"} 0, 232..255, 15],
+ random => [map {"38;5;$_"} List::Util::shuffle(17..231)],
+ rainbow=> [map {"38;5;$_"}
+ 196, # r
+ (map { 196 + $_*6 } 0..4), # +g
+ (map { 226 - $_*6*6 } 0..4), # -r
+ (map { 46 + $_ } 0..4), # +b
+ (map { 51 - $_*6 } 0..4), # -g
+ (map { 21 + $_*6*6 } 0..4), # +r
+ (map { 201 - $_ } 0..4), # -b
+ 196,
+ ],
+ }->{$_[1]} // do {
+ my @vals = split /[^0-9;]/, $_[1]
+ or die "Empty palette resulting from \"$_[1]\"\n";
+ \@vals;
+ };