The Gallery is deprecated. No new Gallery components may be submitted, and modifying existing components is disabled. For more information please read the Gallery Deprecation blog post. This is a static snapshot of the Gallery for archive purposes.
Created: 09/12/11
Last CDN Push: 09/28/11
Build Tag: gallery-2011.09.28-20-06
Project: YUI 3
License: YUI BSD
YUI Version: 3.4.0
Free for use.
The ColorPicker module provides several classes useful for dealing with colors. The Y.Colors class provides a couple of helpful conversion methods allowing conversion between RGB and HSL color formats. The Y.ColorPalette class provides a simple color palette to store and reuse color selections. Finally the Y.ColorPicker widget provides a HTML5 based UI for selecting colors.
<script src="http://yui.yahooapis.com/3.4.0/build/yui/yui-min.js"></script>
YUI({
//Last Gallery Build of this module
gallery: 'gallery-2011.09.28-20-06'
}).use('gallery-colorpicker', function(Y) {
// create an instance of the widget
var colorpicker = new Y.ColorPicker();
// render the widget into the #picker node
colorpicker.render("#picker");
Y.one('#getcolorbutton').on('click',function(ev) {
ev.halt();
var hex = colorpicker.get('hex');
// do something with the hex value....
});
});
All code on this site is licensed under the BSD License unless stated otherwise.