Convert-Color-XTerm
view release on metacpan or search on metacpan
lib/Convert/Color/XTerm.pm view on Meta::CPAN
));
}
foreach my $index ( 0 .. $#colnames )
{
my $c_tmp = Convert::Color->new( $colnames[$index] );
$color[$index] = __PACKAGE__->SUPER::new( $c_tmp->as_rgb8->rgb8 );
$color[$index]->[3] = $index;
}
# These descriptions and formulae from xterm's 256colres.pl
# Next is a 6x6x6 color cube, with an attempt at a gamma correction
foreach my $red ( 0 .. 5 ) {
foreach my $green ( 0 .. 5 ) {
foreach my $blue ( 0 .. 5 ) {
my $index = 16 + ($red*36) + ($green*6) + $blue;
$color[$index] = __PACKAGE__->SUPER::new(
map { $_ ? $_*40 + 55 : 0 } ( $red, $green, $blue )
);
( run in 2.878 seconds using v1.01-cache-2.11-cpan-df04353d9ac )