Docs Home

sb.widgets.colorPalette

@File: /surebert/widget/colorPalette.js

@Author: Paul Visco

@Description: Used to create a websafe color palette table


@Example:


sb.include('widget.colorPalette');

var table = new sb.widget.colorPalette('jimmy');
table.event('click', function(e){
    
    var td = sb.events.target(e);
    if(td.nodeName =='TD'){
            if(table.selectedColor){
                table.selectedColor.style.border='';
            }
        $('body').style.backgroundColor=td.style.backgroundColor;
        td.style.border='1px solid white';
        table.selectedColor = td;
    }
    
});
table.appendToTop('body');