# inputEx - ColorPickerField Usage

This field is a wrapper around the YUI ColorPicker widget.

## Basic ColorPickerField creation

Use the following code to create a basic inputEx ColorPickerField.

new inputEx.ColorPickerField({parentEl: 'container1', label: 'Choose a color', description: 'Click to view the available colors' });

## Smaller ColorPickerField

Use the following code to create a ColorPickerField without controls

var field = new inputEx.ColorPickerField({parentEl: 'container2', label: 'Choose a color', value:'#2626AF', colorPickerOptions:{showcontrols:false} }); // Register the 'updatedEvt' and log the value to the page var logDiv = inputEx.cn('div', null, null, "Log :"); YAHOO.util.Dom.get('container2').appendChild(logDiv); field.updatedEvt.subscribe(function(e,params) { var val = params[0]; logDiv.appendChild( inputEx.cn('div', null, null, "Updated at "+(new Date())+" with value: "+val) ); });