in reply to How to convert RGB decimal to RGB hex and vise versa in Excel sheets?

Whether this is your issue or not I don't know, as I'm not set up to test it. After a quick glance at some documentation, set_custom_color() takes the following arguments:

$workbook->set_custom_color(40, 255, 102, 0 ); # Orange $workbook->set_custom_color(40, 0xFF, 0x66, 0x00); # Same thing $workbook->set_custom_color(40, '#FF6600' ); # Same thing

So it looks like you either need to break up the $sRGB variable into separate hex values, or simply quote the whole thing and prepend it with a #:

$workbook->set_custom_color($back_color, "#$sRGB");

Replies are listed 'Best First'.
Re^2: How to convert RGB decimal to RGB hex and vise versa in Excel sheets?
by thanos1983 (Parson) on Apr 21, 2017 at 23:08 UTC

    Hello stevieb,

    I have test this scenario already, but unfortunately it does not work as I expect it returns another colour.

    Thank you for your time and effort reading and replying to my question.

    Seeking for Perl wisdom...on the process of learning...not there...yet!