Re: Common standard for defining a color?
| From: | Pierre-Alain Joye | Date: | Tue, 03 Feb 2004 18:48:38 +0000 |
| Subject: | Re: Common standard for defining a color? | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-25461@lists.php.net to get a copy of this message | ||
On Tue, 03 Feb 2004 19:39:33 +0100
"Stefan Neufeind" <stefan@neufeind.net> wrote:
> Well, why 100? To have percentages? I'd favor to have all values of
> equal size (here 0 to 255 in this case). Wouldn't that make more
> sense? imagecolorallocatealpha uses 0 to 127 :-((. But others (Pimp,
> SVG, ...) might even do it completely different. In tools like
> photoshop etc. afaik a value of 0..255 for alpha is normal, like for
> any other of those color channels.
Keeping in mind that some backend talk about level of opacity instead of
level of transparency. Percentage is nice, using float makes sense here.
All channels are represented between 0.0 to 1.0. Then it's easy to adapt
to any kind of backend (for the alpha, force the usage of level of
transparency and then invert it). For grayscale, intensities allow easy
grayscale approximation (and faster).
pierre