This file is indexed.

/usr/share/doc/libexcel-writer-xlsx-perl/examples/colors.pl is in libexcel-writer-xlsx-perl 0.47-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
#!/usr/bin/perl -w

################################################################################
#
# Demonstrates Excel::Writer::XLSX's named colors and the Excel color
# palette.
#
# The set_custom_color() Worksheet method can be used to override one of the
# built-in palette values with a more suitable colour. See the main docs.
#
# reverse('©'), March 2002, John McNamara, jmcnamara@cpan.org
#

use strict;
use Excel::Writer::XLSX;

my $workbook = Excel::Writer::XLSX->new( 'colors.xlsx' );

# Some common formats
my $center = $workbook->add_format( align => 'center' );
my $heading = $workbook->add_format( align => 'center', bold => 1 );


######################################################################
#
# Demonstrate the named colors.
#

my %colors = (
    0x08, 'black',
    0x0C, 'blue',
    0x10, 'brown',
    0x0F, 'cyan',
    0x17, 'gray',
    0x11, 'green',
    0x0B, 'lime',
    0x0E, 'magenta',
    0x12, 'navy',
    0x35, 'orange',
    0x21, 'pink',
    0x14, 'purple',
    0x0A, 'red',
    0x16, 'silver',
    0x09, 'white',
    0x0D, 'yellow',

);

my $worksheet1 = $workbook->add_worksheet( 'Named colors' );

$worksheet1->set_column( 0, 3, 15 );

$worksheet1->write( 0, 0, "Index", $heading );
$worksheet1->write( 0, 1, "Index", $heading );
$worksheet1->write( 0, 2, "Name",  $heading );
$worksheet1->write( 0, 3, "Color", $heading );

my $i = 1;

while ( my ( $index, $color ) = each %colors ) {
    my $format = $workbook->add_format(
        fg_color => $color,
        pattern  => 1,
        border   => 1
    );

    $worksheet1->write( $i + 1, 0, $index, $center );
    $worksheet1->write( $i + 1, 1, sprintf( "0x%02X", $index ), $center );
    $worksheet1->write( $i + 1, 2, $color, $center );
    $worksheet1->write( $i + 1, 3, '',     $format );
    $i++;
}


######################################################################
#
# Demonstrate the standard Excel colors in the range 8..63.
#

my $worksheet2 = $workbook->add_worksheet( 'Standard colors' );

$worksheet2->set_column( 0, 3, 15 );

$worksheet2->write( 0, 0, "Index", $heading );
$worksheet2->write( 0, 1, "Index", $heading );
$worksheet2->write( 0, 2, "Color", $heading );
$worksheet2->write( 0, 3, "Name",  $heading );

for my $i ( 8 .. 63 ) {
    my $format = $workbook->add_format(
        fg_color => $i,
        pattern  => 1,
        border   => 1
    );

    $worksheet2->write( ( $i - 7 ), 0, $i, $center );
    $worksheet2->write( ( $i - 7 ), 1, sprintf( "0x%02X", $i ), $center );
    $worksheet2->write( ( $i - 7 ), 2, '', $format );

    # Add the  color names
    if ( exists $colors{$i} ) {
        $worksheet2->write( ( $i - 7 ), 3, $colors{$i}, $center );

    }
}

__END__