Re: Recommendation for color-representation in PEAR-packages
| From: | Stefan Neufeind | Date: | Tue, 17 Feb 2004 17:20:45 +0000 |
| Subject: | Re: Recommendation for color-representation in PEAR-packages | ||
| References: | 1 | Groups: | php.pear.qa |
| Request: | Send a blank email to pear-qa+get-581@lists.php.net to get a copy of this message | ||
n 17 Feb 2004 at 12:12, Jon Parise wrote:
> On Tue, Feb 17, 2004 at 04:56:30PM +0100, Stefan Neufeind wrote:
>
> > Color-representation inside PEAR-packages
> >
[...]
> So if I want to bring some red text, the recommendation would be
> that, instead of just using '#ff0000', I would need to create an
> array and add a dependency on the Image_Color package?
Nope. You would add an array(255, 0, 0) directly and can pretty well
live without any color-conversion, since this is the direct form used
by most APIs. But if you want to use "#FF0000" (e.g. because you
grabbed it from an HTML-page or it was entered by a user) then
Image_Color offers you the functionality for easy transformation into
the array-format, which is intended to be used by most packages for
internal color representation.
And there will be another advantage: We're currently working to
hopefully get a "magic" function in Image_Color to which you can
supply and color representation and which will recognise the string
"#FF0000" as well as "red" easily.
So in short: No need for a dep to Image_Color if you don't want/need
to benefit from the additional functionality. All we say is that the
color will be stored in array-format in a common way - so it's
exchangeable between all packages following that standard-notation.
Regards,
Stefan