Color Class

From: Date: Sun, 25 Nov 2001 23:34:46 +0000
Subject: Color Class
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-3084@lists.php.net to get a copy of this message
As as long time lurker in PEAR and PEAR-DEV, I felt it was about time I spoke up. Last night on #php on OPN, someone came in and was asking about Color Mixing. Basically, was there a PHP class or function or something that you could enter lets say #336699 and #ffffff into and it would return the correctly mixed color. AFAIK, there isn't one present, so I decided to put one together for fun. It can be found here: http://dev.newbienetwork.net/class.colors.php It's a rather simple class, and right now it allows you to mix colors, as well as find color ranges (You want to grab 10 colors from FF0000 to 0000FF) and even change the hue of colors currently contained (making rainbow effects relatively easy). The example above is just a small example. I would like to add on to this, but I would like to see if there is any interest in a class like this. For myself, it is just a fun project to learn more about Color Math and concepts, but if it can be used by others, I would love to take advice, suggestions, ideas, etc. If it could be used, I would like to contribute this class (when finished) to PEAR. Other ideas I had are: Get text color: Enter a color and it returns either a light or dark color to be best viewed. Already implemented and used. Make web safe: make all returned colors websafe colors. This class shouldn't be restricted to web colors only (PHP-GTK user may want to use it, though I don't know in what capacity) but the option should be there. I have started to implement think on this ( hence the unused $websafe array in the class ) Other ideas, suggestion? I know this probably isn't as big as the Metabase Adoption topic or the 54th Monthly Spaces v.s. Tabs debate, but hey, at least it's a colorful topic (bad pun intended). Jason Lotito jason@lehighweb.com www.NewbieNetwork.net

« previous php.pear.dev (#3084) next »