Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sw4/Ext.ux.ColorPicker

Ext JS 4.2x Color Picker Field
https://github.com/sw4/Ext.ux.ColorPicker

Last synced: 27 days ago
JSON representation

Ext JS 4.2x Color Picker Field

Awesome Lists containing this project

README

        

Ext.ux.ColorPicker
==================

Ext JS 4.2x Color Picker Field

**Licensed under [cc by-sa 3.0](http://creativecommons.org/licenses/by-sa/3.0/) with attribution required**

**Demo can be viewed here: http://sw4.github.io/Ext.ux.ColorPicker**

Requirements
=====

Requires canvas support and is based on a standard Ext triggerfield, so supports all native properties. Requires ExtJS JS and CSS to be referenced in your page.*

*Currently only tested in ExtJS 4.2x

Usage
=======
Specify the location of the luminance and spectrum.png images, by setting the luminanceImg and spectrumImg properties on the object (or replacing the two related incidences in the main JS). E.g.

```
Ext.create('Ext.ux.ColorPicker', {
luminanceImg:'images/luminance.png',
spectrumImg:'images/luminance.png'
});
```

Additionally, you can pass a HEX color to `value` to initialize the field with a color already selected.

Sample HTML Page
==================

```


Ext.ux.ColorPicker






Ext.ux.ColorPicker


Note: This specific example will not work correctly due to the fact assets are loaded cross-domain (from rawgithub.com) which contravenes canvas security policy.








Ext.onReady(function() {
var colorPicker = Ext.create('Ext.ux.ColorPicker', {
luminanceImg:'https://rawgithub.com/sw4/Ext.ux.ColorPicker/master/luminance.png',
spectrumImg:'https://rawgithub.com/sw4/Ext.ux.ColorPicker/master/spectrum.png',
value:'#ff0000'
});
colorPicker.render('colorPicker');
});

```