Extends: Jx.Button.Flyout
A Jx.ColorPalette wrapped up in a Jx.Button. The button includes a preview of the currently selected color. Clicking the button opens the color panel.
A color button is essentially a Jx.Button.Flyout where the content of the flyout is a Jx.ColorPalette. For performance, all color buttons share an instance of Jx.ColorPalette which means only one button can be open at a time. This isn’t a huge restriction as flyouts already close each other when opened.
var colorButton = new Jx.Button.Color({
onChange: function(button) {
console.log('color:' + button.options.color + ' alpha: ' +
button.options.alpha);
}
});| change | fired when the color is changed. |
Copyright © 2008, DM Solutions Group Inc.
This file is licensed under an MIT style license
| Jx. | Extends: Jx.Button.Flyout |
| Options | |
| color | a color to initialize the panel with, defaults to #000000 (black) if not specified. |
| alpha | an alpha value to initialize the panel with, defaults to 1 (opaque) if not specified. |
| Constructor | |
| Jx. | initialize a new color button. |
| Functions | |
| clicked | override Jx.Button.Flyout to use a singleton color palette. |
| hide | hide the color panel |
| setColor | set the color represented by this color panel |
| setAlpha | set the alpha represented by this color panel |
| changed | handle the color changing in the palette by updating the preview swatch in the button and firing the change event. |
| updateSwatch | Update the swatch color for the current color |
clicked: function()
override Jx.Button.Flyout to use a singleton color palette.
changed: function( panel )
handle the color changing in the palette by updating the preview swatch in the button and firing the change event.
| panel | Jx.ColorPalette the palette that changed. |
override Jx.Button.Flyout to use a singleton color palette.
clicked: function()
hide the color panel
hide: function()
set the color represented by this color panel
setColor: function( color )
set the alpha represented by this color panel
setAlpha: function( alpha )
handle the color changing in the palette by updating the preview swatch in the button and firing the change event.
changed: function( panel )
Update the swatch color for the current color
updateSwatch: function()