For one thing, it used common variable names which step all over other libraries and my own code and is insanely CSS oriented, so trying to change its layout is a huge pain that’s basically hours of trial an error. I previously used colorjack, which is great but full of quirks. It would probably need some modification depending on use, but you can download it here: Color Picker Tested on IE5.5, IE6, IE7, FF2, Opera 9, Safari 2. The JavaScript is made up of some color methods, a slider control, a handler for input, and the ColorPicker object to put it all together. Some others pickers use this method for a hue map, but don’t include the other maps (S,V,R,G,B). To create the color mixing, the larger map is made of two layers and the vertical slider has four layers (two are used for H, S, or B four layers for R, G, or B). A few years back, I did this, but it didn’t have RGB and was Firefox and IE only ( excellent tutorial here). The other options is to use transparent PNGs and opacity to fake the maps. This is very slow, which is why color pickers that go the JavaScript route often don’t draw the entire map, but instead only 4×4 or 8×8 blocks ( ColorZilla). Some pickers try to generate the entire color map in JavaScript by drawing a 256×256 grid made of divs. There are a lot of nice JavaScript color pickers out there ( colorjack, colourmod, yahoo, dojo, nogray, mootools), but none of them has a full HSB and RGB options of Photoshop’s picker. I haven’t seen one that does that and this is a fun way of showing what JavaScript can do. The main difference in mine is that it has all 6 picking options (H,S,V,R,G,B) not just Hue. Update: Many people have noted “it looks like ” and they are right: there are tons of pickers out there (I listed a few in the original post).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |