The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#!perl

our $DATE = '2016-03-11'; # DATE
our $VERSION = '0.48'; # VERSION

use 5.010;
use strict;
use warnings;

use Text::ANSITable;

binmode(STDOUT, ":utf8");

my $t = Text::ANSITable->new;
my $all_ct = $t->list_color_themes(1);

my $chosen_ct = $ARGV[0] // $t->{color_theme}{name};

$t->columns(['Name', 'Summary']);
for my $name (sort keys %$all_ct) {
    my $ct = $all_ct->{$name};
    my $selected = $chosen_ct eq $name;

    $t->add_row([$name . ($selected ? " (*)" : ""), $ct->{summary}],
                {fgcolor=>($selected && $t->use_color ? 'aaaa00' : undef)});
}

say "Tip: you can run me with color theme name as argument to try it out.";
print $t->draw;

$t = Text::ANSITable->new;
$t->color_theme($chosen_ct);
my $ct = $t->color_theme;
$t->columns(['num','percent%','date','bool?','text']);
$t->add_row([1, 0.4, time(), 1, 'hello']);
$t->add_row([-3.3, 1, time(), 0, 'world']);
$t->add_row_separator;
$t->add_row([$_, $_/10, 1367451584+$_*10000, int(rand()*2), "x$_"])
    for 1..5;

say "Demo table";
print $t->draw;

# ABSTRACT: List available color themes for Text::ANSITable
# PODNAME: ansitable-list-color-themes

__END__

=pod

=encoding UTF-8

=head1 NAME

ansitable-list-color-themes - List available color themes for Text::ANSITable

=head1 VERSION

This document describes version 0.48 of ansitable-list-color-themes (from Perl distribution Text-ANSITable), released on 2016-03-11.

=head1 SYNOPSIS

 % ansitable-list-color-themes

Sample output:

 Tip: you can run me with color theme name as argument to try it out.
 .-------------------------------------------------------------------------------------.
 | Name                                   Summary                                      |
 |                                                                                     |
 | Default::default_gradation             Default (for terminal with black background) |
 | Default::default_gradation_whitebg     Default (for terminal with white background) |
 | Default::default_nogradation           Default (for terminal with black background) |
 | Default::default_nogradation_whitebg   Default (for terminal with white background) |
 | Default::no_color (*)                  Special theme that means no color            |
 `-------------------------------------------------------------------------------------'
 Demo table
 .-------------------------------------------------------.
 |  num   percent%          date           bool?   text  |
 |                                                       |
 |    1     40.00%   2016-03-11 20:25:15     Y     hello |
 | -3.3    100.00%   2016-03-11 20:25:15     N     world |
 +-------------------------------------------------------+
 |    1     10.00%   2013-05-02 09:26:24     N     x1    |
 |    2     20.00%   2013-05-02 12:13:04     Y     x2    |
 |    3     30.00%   2013-05-02 14:59:44     Y     x3    |
 |    4     40.00%   2013-05-02 17:46:24     N     x4    |
 |    5     50.00%   2013-05-02 20:33:04     N     x5    |
 `-------------------------------------------------------'

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/Text-ANSITable>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-Text-ANSITable>.

=head1 BUGS

Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Text-ANSITable>

When submitting a bug or request, please include a test-file or a
patch to an existing test-file that illustrates the bug or desired
feature.

=head1 AUTHOR

perlancar <perlancar@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut