A while ago I made a nifty JavaScript color picker, but never got around to fully testing or releasing it. Recently Mark Burdett contacted me to ask if he could use it.
So I cleaned up the code, converted it to use the excellent jQuery library (which will soon be making it into Drupal) and put it online under a GPL license.
PS: What about jQuery-in-Drupal? Well, I'm essentially waiting for jQuery to hit 1.0. They're now in the 'alpha' stage, with a release candidate on the horizon soon. The adventurous can already try this patch, but the version of jQuery used is not fit for general consumption.

Just doesn't work
Hey!
I was interested by this as I can see uses for it, such as a nifty page colour changer. However, it simply will not run at all for me. Because you don't include a copy of jquery, I had to use a pre-existing copy of it. When I linked it to the http://jquery.com/src/latest/ source, I got a textbox, and that's it. That's in both FF 1.5, IE6 and Opera 9.
This also happens when using my existing copies of jQuery, plus downloading a copy of the alpha release and saving it locally.
Either way, nothing happens.
Any ideas?
Works fine for me
If I replace jquery.js in the demo.html with http://jquery.com/src/jquery-1.0a.js, it works just fine for me. So that version should work.
It works!
Cheers!
I actually downloaded the latest version and renamed it. After renaming the link in the source code, it worked, which is great stuff!
Thanks!
Controlling multiple divs with the same control
Hey!
Ok, I've intergrated this into my site: http://www.dan-atkinson.com and I'd love to put this out as a plugin for Wordpress which would work by allowing users to change which divs are altered, if that's ok?
In my in-page example, everything (bar the header, which is partially an image) is changed.
Anyhoo, I was wondering if you would update the documentation to mention how users can control multiple divs, because it took me a while to figure out! :-)
In the end, I realised of course that you seperate them with commas, after trying unsuccessfully with different lines.
Cheers
Very nice! Controlling foreground colors?
This is a very cool and handy thing -- thanks for releasing it open source.
One thing I need to do is to be able to control foreground and background colors. For instance, I have a client that needs to pick hex colors for a div background, and then pick a text color to go on top of it. I set up the background no problem, but couldn't find a method to set up the color for the text -- just the background.
Is this possible and I've missed it? If not, please consider it an idea for future releases.
Advanced usage
Check out the advanced usage section of the documentation. You have complete control of Farbtastic by specifying a custom callback function.
Advanced usage of setColor
This color wheel is awesome.
I can't get setColor to work as I thought it should. No error occurs, but the text field and the color wheel don't update:
$.farbtastic('#color').setColor('#3399FF');As far as I know, it might be setting some internal variable, but how do I get the text box or color wheel to update to point at that color?
I'm using the version of jQuery that you had on your site, and the color wheel works fine otherwise, so I don't see what the issue might be.
Can you provide some examples such as this under the Advanced Usage section?
Something else that would be really nice would be help on resizing the color wheel to be smaller/larger.
Keep up the good work!
Placeholder
If you are using the same IDs as in my examples, then you're using the ID of the textfield, not the ID of the placeholder. See the documentation.
Farbtastic
I know this is very easy for you but I have been trying for days to change backround color of a table and the foreground color(text)
I know above someone else asked a similiar question and you pointed out
Check out the advanced usage section of the documentation. You have complete control of Farbtastic by specifying a custom callback function
I dont fully understand the code and was hoping you may
write a short demo so as I can adapt.
Thanks
Steve
Possible to convert HSL to CMYK in an output box
Sorry really don't understand color spaces, and I'm not looking for an explanation. When you output the hex values is it rgb or hsl representation? I would like to be able to have an output box for cmyk. Is it possible?
thanks
jeremy
is this a farbtastic bug ?
Hi Steven,
I really like farbtastic plug-in but I've found a problem if the farbtastic object get ou of the screen or div (with scroll) partially and I drag the circle to select one color and continue dragging out of the browser or div.
The error looks like from JQuery code but it's generated because of the coordinates are out off the object or something like that... have you found or somebody report this problem before ?
color property
Hi, first off let me say your color selector is probably one of the best implementations I've seen. I have a problem, I can't seem to be able to get the color property back from it for some reason. I am basically doing something like this
$.farbtastic.('#myId').linkTo(function(){
myColorChangeFunction(someObjectName, $.farbtastic('#myId').color);
}
);
However I keep getting null back for from $.farbtastic('#myId').color.
#myId is the color selector btw. Any insight as to what I might be doing wrong, if anything?
Re: color property
Hey Anony, what you need to do is:
$.farbtastic.('#myId').linkTo(function(color) {myColorChangeFunction(someObjectName, color);
});
The color gets passed as a parameter to the callback function.
Post new comment