Re: Warnings when using Graphics::ColorObject

Discussion in 'Perl Misc' started by Scott Bryce, Dec 21, 2013.

  1. Scott Bryce

    Scott Bryce Guest

    On 12/20/2013 2:32 PM, Ben Morrow wrote:
    > This looks like a bug in Graphics::ColorObject, but it's hard to be
    > sure.


    I was thinking the same thing.

    > Try adding
    >
    > use Carp;
    > $SIG{__WARN__} = \&Carp::cluck;
    >
    > to the top of your script, and see if the extra information helps.


    Use of uninitialized value within @_ in lc at
    C:/Perl/site/lib/Graphics/ColorObject.pm line 1905.
    at C:/Perl/site/lib/Graphics/ColorObject.pm line 1905.
    Graphics::ColorObject::namecolor(undef) called at
    C:/Perl/site/lib/Graphics/ColorObject.pm line 150
    Graphics::ColorObject::new('Graphics::ColorObject') called at
    C:/Perl/site/lib/Graphics/ColorObject.pm line 197
    Graphics::ColorObject::new_RGB('Graphics::ColorObject',
    'ARRAY(0x1e83e2c)') called at C:/Perl/site/lib/Graphics/ColorObject.pm
    line 279
    Graphics::ColorObject::new_HSV('Graphics::ColorObject',
    'ARRAY(0x72a71c)') called at G:\Scratch\killme.pl line 12

    > PDF supports RGB, and the conversion from HSV to RGB is simple and
    > exact (depending on exactly which definition of HSV you want), so you
    > might want to consider using RGB colours instead.


    I get the same warnings when I convert to RGB. I don't need an exact
    conversion. I like to use CMYK when the output is intended to be
    printed. But if I don't need an exact conversion, RGB would probably be
    just as good a CMYK.
    Scott Bryce, Dec 21, 2013
    #1
    1. Advertising

  2. Scott Bryce

    Scott Bryce Guest

    On 12/21/2013 2:06 PM, Ben Morrow wrote:
    > Since you said 'pie charts' I'm assuming you're targeting a desktop
    > printer rather than (say) an imagesetter.


    Yes. I create PDF files that are intended for classroom use. Most of
    them are grayscale, but I like to have the option of color sometimes.

    > In that case IME you usually get better results with RGB, especially
    > in the absence of proper colour management.


    This is something I was not aware of.

    > Mostly this is because RGB has a larger gamut than CMYK,


    That I suspected.

    > Alternatively, you could just copy out the algorithm you want (or,
    > indeed, just get it off Wikipedia).


    I found a Javascript version of an HSV to RBG script on line, which I
    re-wrote in Perl. Given your advice, I will use RBG in the PDF file.

    It looks like the problem is solved, or, at least, an alternative
    without the problem has been found. Thank you for your help!
    Scott Bryce, Dec 22, 2013
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Martin

    Warnings when using % operator

    Martin, Sep 15, 2004, in forum: C Programming
    Replies:
    17
    Views:
    491
    Eric Sosman
    Sep 30, 2004
  2. Stephan Kämper

    Warnings when using RedCloth and Rake

    Stephan Kämper, Jun 22, 2004, in forum: Ruby
    Replies:
    8
    Views:
    103
    Eric Hodel
    Jun 23, 2004
  3. Suresh Govindachar

    Using strict and warnings in embedded perl

    Suresh Govindachar, Jul 14, 2004, in forum: Perl Misc
    Replies:
    0
    Views:
    104
    Suresh Govindachar
    Jul 14, 2004
  4. Ted Sung
    Replies:
    1
    Views:
    299
    Sherm Pendley
    Aug 30, 2004
  5. Scott Bryce
    Replies:
    0
    Views:
    79
    Scott Bryce
    Dec 21, 2013
Loading...

Share This Page