Acko.net
14 Jul 2006

Farbtastic color picker released

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.

Check it out.

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.

Tags:
22 Jul 08:57

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?

22 Jul 09:30

Works fine for me

by Steven

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.

22 Jul 13:49

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!

22 Jul 14:54

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

08 Aug 10:42

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.

08 Aug 10:48

Advanced usage

by Steven

Check out the advanced usage section of the documentation. You have complete control of Farbtastic by specifying a custom callback function.

11 Aug 06:44

Advanced usage of setColor

by Daniel Gibby

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!

12 Aug 09:33

Placeholder

by Steven

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.

08 Mar 15:20

Farbtastic

by Steve Whiting

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

22 Jun 10:40

Possible to convert HSL to CMYK in an output box

by jeremy

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

01 Aug 11:52

is this a farbtastic bug ?

by Alex

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 ?

02 Nov 06:57

color property

by Anonymous

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?

03 Jan 13:20

Re: color property

by phred

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

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <b> <dd> <dl> <dt> <i> <li> <ol> <u> <ul> <img> <em> <p> <br> <span> <div> <h2> <h3> <abbr> <small> <table> <tr> <td> <strong> <acronym> <th> <blockquote>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options