tAlpha(this._barL2, (vertPerRev>horzPer) ? horzPer : vertPerRev) tAlpha(this._bar元, (vertPer>horzPer) ? horzPer : vertPer) tAlpha(this._barL4, (vertPer>horzPerRev) ? horzPerRev : vertPer) UPGRADE TO DO ( tested ) in "ColorPicker.js"įunction : .updateSliderVisuals The selected color differ from the color showed in the slider. We don’t have the correct color in the slider. Basically, you’d need an algorithym to detect what each color’s background would be (the reverse of how it normally works). If I wanted it to start on a custom color, like one that was in a database for instance, maybe #0000FF, the color box would be correct but the background of the picker would be red, or maybe white. For instance, you set you colorpicker to start on #FF0000 and you set the background to red as well. I foresee this as quite a task, maybe a fun challenge. The one thing that bothers me is the difficulty in writing a colorpicker that can "start" on any color. I really like how you used tables unlike all the standardistas out there that think tables are "wrong." This colorpicker is the best I’ve seen so far. 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 |