YUI recommends YUI3.
YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.
This documentation is no longer maintained.
The Color Picker below looks much like the pickers in other examples. However, two changes have been made:
Element ID strings for the Color Picker Control are stored in the YAHOO.widget.ColorPicker.prototype.ID
object. We've dumped the full output of that object to the logger to give you a sense of the object's full contents.
For the purposes of this example, we'll override the R
, G
, and B
members of that object. We'll create a new object with those members and then use YAHOO.lang.merge
to integrate our new values with the existing object; this will override only the members we specify in the second argument of the merge
function:
We can use the same technique to override members of YAHOO.widget.ColorPicker.prototype.TXT
for the purposes of customization or internationalization. Again, you can find the full contents of that object dumped to the logger console.
Here, we'll modify the R
, G
, and B
members and change those text strings to "Red", "Green", and "Blue":
All YUI 2.x users should review the YUI 2.8.2 security bulletin, which discusses a vulnerability present in YUI 2.4.0-2.8.1.
Copyright © 2013 Yahoo! Inc. All rights reserved.