Skip to content

Instantly share code, notes, and snippets.

@ynonp
Created July 9, 2012 12:10
Show Gist options
  • Save ynonp/3076116 to your computer and use it in GitHub Desktop.
Save ynonp/3076116 to your computer and use it in GitHub Desktop.
use v5.14;
use Spreadsheet::WriteExcel;
# Create the work book
my $workbook = Spreadsheet::WriteExcel->new('writer1.xls');
my $ws = $workbook->add_worksheet();
my @data = qw/red blue green white cyan magenta black/;
while ( my ($idx, $val) = each @data ) {
my $fmt = $workbook->add_format;
$fmt->set_color( $val );
$ws->write( $idx, 0, $val, $fmt );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment