[ 3 posts ]

Jeff Flesher

  • Username: jflesher
  • Joined: Thu Sep 03, 2009 11:19 am
  • Posts: 17
  • Location: USA
  • Offline
  • Profile

How do you set Colorpicker default color

Post Posted: Thu Sep 03, 2009 2:16 pm
+0-
How do you set Colorpicker default color?
I am using the example at http://developer.yahoo.com/yui/examples ... ple11.html
I tried setting the Hex value in YAHOO.widget.ColorPicker(hex: fff000..., that did not work
I tried setting YAHOO.util.Dom.setStyle("current-colorBbg", "backgroundColor", '#fff000'); that did not work

I don't see an example of this, it needs to have this feature; I'm sure it does, but I can't figure it out today.
Jeff
http://vetshelpcenter.com/

Luke Smith

YUI Contributor

  • Username: lsmith
  • Joined: Thu Aug 28, 2008 7:50 am
  • Posts: 514
  • Location: Sunnyvale
  • Twitter: ls_n
  • GitHub: lsmith
  • Gists: lsmith
  • IRC: ls_n
  • YUI Developer
  • Offline
  • Profile
Tags:

Re: How do you set Colorpicker default color

Post Posted: Thu Sep 03, 2009 7:43 pm
+0-
Try setting rgb in the constructor.

Code:
var cp = new YAHOO.widget.ColorPicker({
    rgb: YAHOO.util.Color.hex2rgb('fff000')
});


Which version of YUI are you using?

Jeff Flesher

  • Username: jflesher
  • Joined: Thu Sep 03, 2009 11:19 am
  • Posts: 17
  • Location: USA
  • Offline
  • Profile

Re: How do you set Colorpicker default color

Post Posted: Thu Sep 03, 2009 8:33 pm
+0-
YUI version 2.7.0

That worked; not sure why hex didn't work.

Thanks
  [ 3 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum