Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Getting the background color of a cell in an existing Excel spreadsheet

by duyet (Friar)
on Apr 19, 2017 at 11:54 UTC ( [id://1188275]=note: print w/replies, xml ) Need Help??


in reply to Re: Getting the background color of a cell in an existing Excel spreadsheet
in thread Getting the background color of a cell in an existing Excel spreadsheet

There is no "ColorIdxToRGB" ... the correct syntax is:
$workbook->color_idx_to_rgb( $format->{Fill}[1] )
  • Comment on Re^2: Getting the background color of a cell in an existing Excel spreadsheet
  • Download Code

Replies are listed 'Best First'.
Re^3: Getting the background color of a cell in an existing Excel spreadsheet
by thanos1983 (Parson) on Apr 19, 2017 at 22:28 UTC

    Hello duyet,

    Just to add both methods can be used, I just test it:

    my $sRGB = $parser->ColorIdxToRGB($format->{Fill}->[2]); my $sRGB_2 = $workbook->color_idx_to_rgb($format->{Fill}->[2]);

    Also from the source code of the Spreadsheet::ParseExcel:

    #--------------------------------------------------------------------- +--------- # ColorIdxToRGB (for Spreadsheet::ParseExcel) # # Returns for most recently opened book for compatibility, use # Workbook::color_idx_to_rgb instead # #--------------------------------------------------------------------- +--------- sub ColorIdxToRGB { my ( $sPkg, $iIdx ) = @_; unless( defined $currentbook ) { return ( ( defined $aColor[$iIdx] ) ? $aColor[$iIdx] : $aColor[0] +); } return $currentbook->color_idx_to_rgb( $iIdx ); }
    Seeking for Perl wisdom...on the process of learning...not there...yet!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1188275]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-26 01:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found