color picker

Permalink 1 user found helpful
has anyone developed a colour picker that works with their blocks in edit/add mode? I've been trying to use JQuery colorpicker, but I'm getting messed around with layers.

TravisN
 
TravisN replied on at Permalink Reply
TravisN
It's okay. I've got it working
Remo replied on at Permalink Reply
Remo
mind to post the solution? someone else might have the same problem too

thanks!
TravisN replied on at Permalink Reply
TravisN
I am more than happy to upload the code, however I still want to make some changes to the core routines in the original JQuery Colorpicker scripts.

I currently have it implemented with a field and colorpicker box, so users can enter the info or select it. The color picker box is separate to the field; it is not the implementation where if you select the field the colorpicker appears.

The main issue I'm having at the moment is the hsb values are not appearing, and I need to work this out.

But if anyone wants the code in the mean time let me know and I'll upload it.
TravisN replied on at Permalink Reply 1 Attachment
TravisN
Just a few minor changes to the code to remove some block specific code in the auto.js and colorpicker.css files.
TravisN replied on at Permalink Reply 1 Attachment
TravisN
Here is the implementation of the color picker I am using. Note this is an altered version of the JQuery colorpicker as used in the concrete5 core.

To get my version or the original code to work correctly it needs to be implemented in the DOM format, and a z-index of at least 1001 added to the .colorpicker css class.

It is possible to implement it using other methods but you may run into clipping or layer issues.

How my version differs:
1. added "none" (no fill) to the dialog
2. changed the "widget" button to be 16px high - so that it can be used inline with text fields without disrupting aesthetics
3. if used with a text field, colors can be entered in the text field, and has bi-directional update with the color dialog.
4. when "none" (no fill) is selected, returns a value of "none" in the hex variable
5. added "cancel" button and change appearance of "submit" button to "OK" for aesthetics and to increase clarity to users.

If you don't want to use the text field simply change the input type to "hidden" and remove the "color_field.bind('change'.. function. Line 56 is there because I'm reading stored values. If your not then you can delete this and simply add
color:"color hex value"
between lines 11 and 12.

Happy coding
vGibson replied on at Permalink Reply
vGibson
Thank you for this but I have a small problem. I need to use two instances of this in one dialog. How would I go about doing that?
vGibson replied on at Permalink Reply
vGibson
NVM, I'm using the core widget now :)
BreakfastStudio replied on at Permalink Reply
BreakfastStudio
I hope this gets supported in the latest C5 coz this post was still in 2009! :D