(none) imager-devel
/ help / lists / applications / search /
 

Re: Imager-0.38pre9 Released.

From: Mike Depot (
01764@xyz.molar.is)
Date: Sat 19 May 2001 - 05:45:07 UTC

  • Next message: Arnar Mar Hrafnkelsson: "Imager-0.38 of to CPAN"

    > The existing interface is used in the version currently on CPAN, this
    > isn't really a valid argument.

    Opps, that message from Arnar contained "This really is the last version
    (we hope) before a CPAN release." I mis-interpreted that to mean Imager
    hadn't been released to CPAN yet at all. That changes everything...

    > Would you object to Imager::Color accepting both type of interface?

    I like the named parameter interface better and I understand the need for
    backward compatibility. I think it might be a good idea to support both,
    perhaps by checking if the first param is an href then assume named params
    and ignore any remaining list params (there shouldn't be any.)

    > We only get the problem of distinguishing between:
    >
    > $c = Imager::Color->new(red=>100, green=>0, blue=>255, alpha=>128);
    > and:
    > $c = Imager::Color->new('red'); # lookup in /usr/X11R6/lib/X11/rgb.txt?
    >...
    > We could distinuguish between the 2 by requiring the '-', but then we'd
    > have to rework all the existing named parameter code for consistency.

    We could name the params something like color_red, color_green,
    color_blue...
    or better yet, use a lref to pass all three since they should always go
    together:
    $c = Imager::Color->new(rgb=>[100, 0, 255], alpha=>128);

    > Future additions to the interface are likely to use named parameters.
    Great :-)



  •