Changeset 1776

Show
Ignore:
Timestamp:
03/26/2007 02:17:29 AM (20 months ago)
Author:
wei
Message:

update colorpicker.js

Location:
branches/3.0/framework/Web/Javascripts
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/3.0/framework/Web/Javascripts/js/compressed/colorpicker.js

    r1775 r1776  
    11 
     2if(typeof(Rico)=="undefined")Rico={};Rico.Color=Class.create();Rico.Color.prototype={initialize:function(red,green,blue){this.rgb={r:red,g:green,b:blue};},setRed:function(r){this.rgb.r=r;},setGreen:function(g){this.rgb.g=g;},setBlue:function(b){this.rgb.b=b;},setHue:function(h){var hsb=this.asHSB();hsb.h=h;this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);},setSaturation:function(s){var hsb=this.asHSB();hsb.s=s;this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);},setBrightness:function(b){var hsb=this.asHSB();hsb.b=b;this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);},darken:function(percent){var hsb=this.asHSB();this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,Math.max(hsb.b-percent,0));},brighten:function(percent){var hsb=this.asHSB();this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,Math.min(hsb.b+percent,1));},blend:function(other){this.rgb.r=Math.floor((this.rgb.r+other.rgb.r)/2);this.rgb.g=Math.floor((this.rgb.g+other.rgb.g)/2);this.rgb.b=Math.floor((this.rgb.b+other.rgb.b)/2);},isBright:function(){var hsb=this.asHSB();return this.asHSB().b>0.5;},isDark:function(){return!this.isBright();},asRGB:function(){return"rgb("+this.rgb.r+","+this.rgb.g+","+this.rgb.b+")";},asHex:function(){return"#"+this.rgb.r.toColorPart()+this.rgb.g.toColorPart()+this.rgb.b.toColorPart();},asHSB:function(){return Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b);},toString:function(){return this.asHex();}};Rico.Color.createFromHex=function(hexCode){if(hexCode.indexOf('#')==0) 
     3hexCode=hexCode.substring(1);var red="ff",green="ff",blue="ff";if(hexCode.length>4) 
     4{red=hexCode.substring(0,2);green=hexCode.substring(2,4);blue=hexCode.substring(4,6);} 
     5else if(hexCode.length>0&hexCode.length<4) 
     6{var r=hexCode.substring(0,1);var g=hexCode.substring(1,2);var b=hexCode.substring(2);red=r+r;green=g+g;blue=b+b;} 
     7return new Rico.Color(parseInt(red,16),parseInt(green,16),parseInt(blue,16));} 
     8Rico.Color.createColorFromBackground=function(elem){var actualColor=Element.getStyle($(elem),"background-color");if(actualColor=="transparent"&&elem.parent) 
     9return Rico.Color.createColorFromBackground(elem.parent);if(actualColor==null) 
     10return new Rico.Color(255,255,255);if(actualColor.indexOf("rgb(")==0){var colors=actualColor.substring(4,actualColor.length-1);var colorArray=colors.split(",");return new Rico.Color(parseInt(colorArray[0]),parseInt(colorArray[1]),parseInt(colorArray[2]));} 
     11else if(actualColor.indexOf("#")==0){return Rico.Color.createFromHex(actualColor);} 
     12else 
     13return new Rico.Color(255,255,255);} 
     14Rico.Color.HSBtoRGB=function(hue,saturation,brightness){var red=0;var green=0;var blue=0;if(saturation==0){red=parseInt(brightness*255.0+0.5);green=red;blue=red;} 
     15else{var h=(hue-Math.floor(hue))*6.0;var f=h-Math.floor(h);var p=brightness*(1.0-saturation);var q=brightness*(1.0-saturation*f);var t=brightness*(1.0-(saturation*(1.0-f)));switch(parseInt(h)){case 0:red=(brightness*255.0+0.5);green=(t*255.0+0.5);blue=(p*255.0+0.5);break;case 1:red=(q*255.0+0.5);green=(brightness*255.0+0.5);blue=(p*255.0+0.5);break;case 2:red=(p*255.0+0.5);green=(brightness*255.0+0.5);blue=(t*255.0+0.5);break;case 3:red=(p*255.0+0.5);green=(q*255.0+0.5);blue=(brightness*255.0+0.5);break;case 4:red=(t*255.0+0.5);green=(p*255.0+0.5);blue=(brightness*255.0+0.5);break;case 5:red=(brightness*255.0+0.5);green=(p*255.0+0.5);blue=(q*255.0+0.5);break;}} 
     16return{r:parseInt(red),g:parseInt(green),b:parseInt(blue)};} 
     17Rico.Color.RGBtoHSB=function(r,g,b){var hue;var saturaton;var brightness;var cmax=(r>g)?r:g;if(b>cmax) 
     18cmax=b;var cmin=(r<g)?r:g;if(b<cmin) 
     19cmin=b;brightness=cmax/255.0;if(cmax!=0) 
     20saturation=(cmax-cmin)/cmax;else 
     21saturation=0;if(saturation==0) 
     22hue=0;else{var redc=(cmax-r)/(cmax-cmin);var greenc=(cmax-g)/(cmax-cmin);var bluec=(cmax-b)/(cmax-cmin);if(r==cmax) 
     23hue=bluec-greenc;else if(g==cmax) 
     24hue=2.0+redc-bluec;else 
     25hue=4.0+greenc-redc;hue=hue/6.0;if(hue<0) 
     26hue=hue+1.0;} 
     27return{h:hue,s:saturation,b:brightness};} 
    228Prado.WebUI.TColorPicker=Class.create();Object.extend(Prado.WebUI.TColorPicker,{palettes:{Small:[["fff","fcc","fc9","ff9","ffc","9f9","9ff","cff","ccf","fcf"],["ccc","f66","f96","ff6","ff3","6f9","3ff","6ff","99f","f9f"],["c0c0c0","f00","f90","fc6","ff0","3f3","6cc","3cf","66c","c6c"],["999","c00","f60","fc3","fc0","3c0","0cc","36f","63f","c3c"],["666","900","c60","c93","990","090","399","33f","60c","939"],["333","600","930","963","660","060","366","009","339","636"],["000","300","630","633","330","030","033","006","309","303"]],Tiny:[["ffffff","00ff00","008000","0000ff"],["c0c0c0","ffff00","ff00ff","000080"],["808080","ff0000","800080","000000"]]},UIImages:{'button.gif':'button.gif','background.png':'background.png'}});Object.extend(Prado.WebUI.TColorPicker.prototype,{initialize:function(options) 
    329{var basics={Palette:'Small',ClassName:'TColorPicker',Mode:'Basic',OKButtonText:'OK',CancelButtonText:'Cancel',ShowColorPicker:true} 
  • branches/3.0/framework/Web/Javascripts/js/debug/colorpicker.js

    <
    r1775 r1776  
     1//-------------------- ricoColor.js 
     2if(typeof(Rico) == "undefined") Rico = {}; 
     3 
     4Rico.Color = Class.create(); 
     5 
     6Rico.Color.prototype = { 
     7 
     8   initialize: function(red, green, blue) { 
     9      this.rgb = { r: red, g : green, b : blue }; 
     10   }, 
     11 
     12   setRed: function(r) { 
     13      this.rgb.r = r; 
     14   }, 
     15 
     16   setGreen: function(g) { 
     17      this.rgb.g = g; 
     18   }, 
     19 
     20   setBlue: function(b) { 
     21      this.rgb.b = b; 
     22   }, 
     23 
     24   setHue: function(h) { 
     25 
     26      // get an HSB model, and set the new hue... 
     27      var hsb = this.asHSB(); 
     28      hsb.h = h; 
     29 
     30      // convert back to RGB... 
     31      this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, hsb.b); 
     32   }, 
     33 
     34   setSaturation: function(s) { 
     35      // get an HSB model, and set the new hue... 
     36      var hsb = this.asHSB(); 
     37      hsb.s = s; 
     38 
     39      // convert back to RGB and set values... 
     40      this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, hsb.b); 
     41   }, 
     42 
     43   setBrightness: function(b) { 
     44      // get an HSB model, and set the new hue... 
     45      var hsb = this.asHSB(); 
     46      hsb.b = b; 
     47 
     48      // convert back to RGB and set values... 
     49      this.rgb = Rico.Color.HSBtoRGB( hsb.h, hsb.s, hsb.b ); 
     50   }, 
     51 
     52   darken: function(percent) { 
     53      var hsb  = this.asHSB(); 
     54      this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, Math.max(hsb.b - percent,0)); 
     55   }, 
     56 
     57   brighten: function(percent) { 
     58      var hsb  = this.asHSB(); 
     59      this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, Math.min(hsb.b + percent,1)); 
     60   }, 
     61 
     62   blend: function(other) { 
     63      this.rgb.r = Math.floor((this.rgb.r + other.rgb.r)/2); 
     64      this.rgb.g = Math.floor((this.rgb.g + other.rgb.g)/2); 
     65      this.rgb.b = Math.floor((this.rgb.b + other.rgb.b)/2); 
     66   }, 
     67 
     68   isBright: function() { 
     69      var hsb = this.asHSB(); 
     70      return this.asHSB().b > 0.5; 
     71   }, 
     72 
     73   isDark: function() { 
     74      return ! this.isBright(); 
     75   }, 
     76 
     77   asRGB: function() { 
     78      return "rgb(" + this.rgb.r + "," + this.rgb.g + "," + this.rgb.b + ")"; 
     79   }, 
     80 
     81   asHex: function() { 
     82      return "#" + this.rgb.r.toColorPart() + this.rgb.g.toColorPart() + this.rgb.b.toColorPart(); 
     83   }, 
     84 
     85   asHSB: function() { 
     86      return Rico.Color.RGBtoHSB(this.rgb.r, this.rgb.g, this.rgb.b); 
     87   }, 
     88 
     89   toString: function() { 
     90      return this.asHex(); 
     91   } 
     92 
     93}; 
     94 
     95Rico.Color.createFromHex = function(hexCode) { 
     96 
     97   if ( hexCode.indexOf('#') == 0 ) 
     98      hexCode = hexCode.substring(1); 
     99 
     100   var red = "ff", green = "ff", blue="ff"; 
     101   if(hexCode.length > 4) 
     102        { 
     103           red   = hexCode.substring(0,2); 
     104           green = hexCode.substring(2,4); 
     105           blue  = hexCode.substring(4,6); 
     106        } 
     107        else if(hexCode.length > 0 & hexCode.length < 4) 
     108        { 
     109          var r = hexCode.substring(0,1); 
     110          var g = hexCode.substring(1,2); 
     111          var b = hexCode.substring(2); 
     112          red = r+r; 
     113          green = g+g; 
     114          blue = b+b; 
     115        } 
     116   return new Rico.Color( parseInt(red,16), parseInt(green,16), parseInt(blue,16) ); 
     117} 
     118 
     119/** 
     120 * Factory method for creating a color from the background of 
     121 * an HTML element. 
     122 */ 
     123Rico.Color.createColorFromBackground = function(elem) { 
     124 
     125   var actualColor = Element.getStyle($(elem), "background-color"); 
     126  if ( actualColor == "transparent" && elem.parent ) 
     127      return Rico.Color.createColorFromBackground(elem.parent); 
     128 
     129   if ( actualColor == null ) 
     130      return new Rico.Color(255,255,255); 
     131 
     132   if ( actualColor.indexOf("rgb(") == 0 ) { 
     133      var colors = actualColor.substring(4, actualColor.length - 1 ); 
     134      var colorArray = colors.split(","); 
     135      return new Rico.Color( parseInt( colorArray[0] ), 
     136                            parseInt( colorArray[1] ), 
     137                            parseInt( colorArray[2] )  ); 
     138 
     139   } 
     140   else if ( actualColor.indexOf("#") == 0 ) { 
     141          return Rico.Color.createFromHex(actualColor); 
     142   } 
     143   else 
     144      return new Rico.Color(255,255,255); 
     145} 
     146 
     147Rico.Color.HSBtoRGB = function(hue, saturation, brightness) { 
     148 
     149   var red   = 0; 
     150        var green = 0; 
     151        var blue  = 0; 
     152 
     153   if (saturation == 0) { 
     154      red = parseInt(brightness * 255.0 + 0.5); 
     155           green = red; 
     156           blue = red; 
     157        } 
     158        else { 
     159      var h = (hue - Math.floor(hue)) * 6.0; 
     160      var f = h - Math.floor(h); 
     161      var p = brightness * (1.0 - saturation); 
     162      var q = brightness * (1.0 - saturation * f); 
     163      var t = brightness * (1.0 - (saturation * (1.0 - f))); 
     164 
     165      switch (parseInt(h)) { 
     166         case 0: 
     167            red   = (brightness * 255.0 + 0.5); 
     168            green = (t * 255.0 + 0.5); 
     169            blue  = (p * 255.0 + 0.5); 
     170            break; 
     171         case 1: 
     172            red   = (q * 255.0 + 0.5); 
     173            green = (brightness * 255.0 + 0.5); 
     174            blue  = (p * 255.0 + 0.5); 
     175            break; 
     176         case 2: 
     177            red   = (p * 255.0 + 0.5); 
     178            green = (brightness * 255.0 + 0.5); 
     179            blue  = (t * 255.0 + 0.5); 
     180            break; 
     181         case 3: 
     182            red   = (p * 255.0 + 0.5); 
     183            green = (q * 255.0 + 0.5); 
     184            blue  = (brightness * 255.0 + 0.5); 
     185            break; 
     186         case 4: 
     187            red   = (t * 255.0 + 0.5); 
     188            green = (p * 255.0 + 0.5); 
     189            blue  = (brightness * 255.0 + 0.5); 
     190            break; 
     191          case 5: 
     192            red   = (brightness * 255.0 + 0.5); 
     193            green = (p * 255.0 + 0.5); 
     194            blue  = (q * 255.0 + 0.5); 
     195            break; 
     196            } 
     197        } 
     198 
     199   return { r : parseInt(red), g : parseInt(green) , b : parseInt(blue) }; 
     200} 
     201 
     202Rico.Color.RGBtoHSB = function(r, g, b) { 
     203 
     204   var hue; 
     205   var saturaton; 
     206   var brightness; 
     207 
     208   var cmax = (r > g) ? r : g; 
     209   if (b > cmax) 
     210      cmax = b; 
     211 
     212   var cmin = (r < g) ? r : g; 
     213   if (b < cmin) 
     214      cmin = b; 
     215 
     216   brightness = cmax / 255.0; 
     217   if (cmax != 0) 
     218      saturation = (cmax - cmin)/cmax; 
     219   else 
     220      saturation = 0; 
     221 
     222   if (saturation == 0) 
     223      hue = 0; 
     224   else { 
     225      var redc   = (cmax - r)/(cmax - cmin); 
     226        var greenc = (cmax - g)/(cmax - cmin); 
     227        var bluec  = (cmax - b)/(cmax - cmin); 
     228 
     229        if (r == cmax) 
     230           hue = bluec - greenc; 
     231        else if (g == cmax) 
     232           hue = 2.0 + redc - bluec; 
     233      else 
     234           hue = 4.0 + greenc - redc; 
     235 
     236        hue = hue / 6.0; 
     237        if (hue < 0) 
     238           hue = hue + 1.0; 
     239   } 
     240 
     241   return { h : hue, s : saturation, b : brightness }; 
     242} 
     243 
     244 
    1245Prado.WebUI.TColorPicker = Class.create(); 
    2246 
    3247Object.extend(Prado.WebUI.TColorPicker, 
    4248{ 
    5         palettes:  
     249        palettes: 
    6250        { 
    7251                Small : [["fff", "fcc", "fc9", "ff9", "ffc", "9f9", "9ff", "cff", "ccf", "fcf"], 
     
    18262        }, 
    19263 
    20         UIImages :  
     264        UIImages : 
    21265        { 
    22266                'button.gif' : 'button.gif', 
     
    29273}); 
    30274 
    31 Object.extend(Prado.WebUI.TColorPicker.prototype,  
     275Object.extend(Prado.WebUI.TColorPicker.prototype, 
    32276{ 
    33277        initialize : function(options) 
    34278        { 
    35                 var basics =  
     279                var basics = 
    36280                { 
    37281                        Palette : 'Small', 
     
    42286                        ShowColorPicker : true 
    43287                } 
    44                  
     288 
    45289                this.element = null; 
    46290                this.showing = false; 
     
    58302        updatePicker : function(e) 
    59303        { 
    60                 var color = Rico.Color.createFromHex(this.input.value);  
     304                var color = Rico.Color.createFromHex(this.input.value); 
    61305                this.button.style.backgroundColor = color.toString(); 
    62306        }, 
    63          
     307 
    64308        buttonOnClick : function(event) 
    65309        { 
     
    85329                } 
    86330                this.show(mode); 
    87         },               
     331        }, 
    88332 
    89333        show : function(type) 
     
    97341                        this.element.style.left = pos[0] + "px"; 
    98342                        this.element.style.display = "block"; 
    99                          
     343 
    100344                        this.ieHack(type); 
    101345 
     
    104348                        this._documentKeyDownEvent = this.keyPressed.bindEvent(this, type); 
    105349                        Event.observe(document.body, "click", this._documentClickEvent); 
    106                         Event.observe(document,"keydown", this._documentKeyDownEvent);  
     350                        Event.observe(document,"keydown", this._documentKeyDownEvent); 
    107351                        this.showing = true; 
    108352 
     
    116360                } 
    117361        }, 
    118          
     362 
    119363        hide : function(event) 
    120364        { 
     
    127371                        this.showing = false; 
    128372                        Event.stopObserving(document.body, "click", this._documentClickEvent); 
    129                         Event.stopObserving(document,"keydown", this._documentKeyDownEvent);  
    130                          
     373                        Event.stopObserving(document,"keydown", this._documentKeyDownEvent); 
     374 
    131375                        if(this._observingMouseMove) 
    132                         {                        
    133                                 Event.stopObserving(document.body, "mousemove", this._onMouseMove);      
     376                        { 
     377                                Event.stopObserving(document.body, "mousemove", this._onMouseMove); 
    134378                                this._observingMouseMove = false; 
    135379                        } 
     
    153397                        within = within || el == this.input; 
    154398                        if(within) break; 
    155                         el = el.parentNode;                      
     399                        el = el.parentNode; 
    156400                } 
    157401                while(el); 
     
    159403        }, 
    160404 
    161         ieHack : function()  
     405        ieHack : function() 
    162406        { 
    163407                // IE hack 
    164                 if(this.iePopUp)  
     408                if(this.iePopUp) 
    165409                { 
    166410                        this.iePopUp.style.display = "block"; 
     
    205449        cellOnClick : function(e) 
    206450        { 
    207                 var el = Event.element(e);  
     451                var el = Event.element(e); 
    208452                if(el.tagName.toLowerCase() != "img") 
    209453                        return; 
     
    221465 
    222466        getFullPickerContainer : function(pickerID) 
    223         {                        
     467        { 
    224468                //create the 3 buttons 
    225                 this.buttons =  
     469                this.buttons = 
    226470                { 
    227471                        //Less   : INPUT({value:'Less Colors', className:'button', type:'button'}), 
     
    229473                        Cancel : INPUT({value:this.options.CancelButtonText, className:'button', type:'button'}) 
    230474                }; 
    231                  
     475 
    232476                //create the 6 inputs 
    233477                var inputs = {}; 
     
    240484                inputs['HEX'] = INPUT({className:'hex',type:'text',size:'6',maxlength:'6'}); 
    241485                this.inputs = inputs; 
    242                  
     486 
    243487                var images = Prado.WebUI.TColorPicker.UIImages; 
    244488 
     
    246490                this.inputs['oldColor'] = SPAN({className:'oldColor'}); 
    247491 
    248                 var inputsTable =  
     492                var inputsTable = 
    249493                        TABLE({className:'inputs'}, TBODY(null, 
    250494                                TR(null, 
     
    259503                                        TD(null,'S:'), 
    260504                                        TD(null,this.inputs['S'], '%')), 
    261                                  
    262                                 TR(null,  
     505 
     506                                TR(null, 
    263507                                        TD(null,'V:'), 
    264508                                        TD(null,this.inputs['V'], '%')), 
    265                                  
    266                                 TR(null,  
     509 
     510                                TR(null, 
    267511                                        TD({className:'gap'},'R:'), 
    268512                                        TD({className:'gap'},this.inputs['R'])), 
    269                                  
    270                                 TR(null,  
     513 
     514                                TR(null, 
    271515                                        TD(null,'G:'), 
    272516                                        TD(null, this.inputs['G'])), 
    273517 
    274                                 TR(null,  
     518                                TR(null, 
    275519                                        TD(null,'B:'), 
    276520                                        TD(null, this.inputs['B'])), 
    277521 
    278                                 TR(null,  
     522                                TR(null, 
    279523                                        TD({className:'gap'},'#'), 
    280524                                        TD({className:'gap'},this.inputs['HEX'])) 
    281525                        )); 
    282526 
    283                 var UIimages =  
    284                 {                
     527                var UIimages = 
     528                { 
    285529                        selector : SPAN({className:'selector'}), 
    286530                        background : SPAN({className:'colorpanel'}), 
     
    295539                        UIimages['background'] = SPAN({className:'colorpanel',style:filter+"(src='"+images['background.png']+"' sizingMethod=scale);"}) 
    296540                } 
    297                  
     541 
    298542                this.inputs = Object.extend(this.inputs, UIimages); 
    299543 
    300                 var pickerTable =  
     544                var pickerTable = 
    301545                        TABLE(null,TBODY(null, 
    302546                                TR({className:'selection'}, 
     
    305549                                        TD({className:'inputs'}, inputsTable) 
    306550                                ), 
    307                                 TR({className:'options'},  
    308                                         TD({colSpan:3},  
    309                                                 this.buttons['OK'],  
     551                                TR({className:'options'}, 
     552                                        TD({colSpan:3}, 
     553                                                this.buttons['OK'], 
    310554                                                this.buttons['Cancel']) 
    311555                                ) 
    312556                        )); 
    313                  
     557 
    314558                return DIV({className:this.options['ClassName']+" FullColorPicker", 
    315559                                                id:pickerID+"_picker"},pickerTable); 
     
    322566                this.setColor(color,true); 
    323567 
    324                 var i = 0;  
     568                var i = 0; 
    325569                for(var type in this.inputs) 
    326570                { 
    327                         Event.observe(this.inputs[type], "change",  
     571                        Event.observe(this.inputs[type], "change", 
    328572                                this.onInputChanged.bindEvent(this,type)); 
    329573                        i++; 
     
    331575                        if(i > 6) break; 
    332576                } 
    333          
     577 
    334578                this.isMouseDownOnColor = false; 
    335579                this.isMouseDownOnHue = false; 
     
    344588                Event.observe(this.inputs.hue, "mousedown", this._onHueMouseDown); 
    345589                Event.observe(this.inputs.slider, "mousedown", this._onHueMouseDown); 
    346                  
     590 
    347591                Event.observe(document.body, "mouseup", this._onMouseUp); 
    348                  
     592 
    349593                this.observeMouseMovement(); 
    350594 
     
    359603                        Event.observe(document.body, "mousemove", this._onMouseMove); 
    360604                        this._observingMouseMove = true; 
    361                 }                
     605                } 
    362606        }, 
    363607 
     
    390634                        this.changeH(ev); 
    391635                Event.stop(ev); 
    392         },       
     636        }, 
    393637 
    394638        changeSV : function(ev) 
     
    397641                var py = Event.pointerY(ev); 
    398642                var pos = Position.cumulativeOffset(this.inputs.background); 
    399                  
    400                 var x = this.truncate(px - pos[0],0,255);  
     643 
     644                var x = this.truncate(px - pos[0],0,255); 
    401645                var y = this.truncate(py - pos[1],0,255); 
    402646 
     
    407651                var current_s = parseInt(this.inputs.S.value); 
    408652                var current_b = parseInt(this.inputs.V.value); 
    409                  
     653 
    410654                if(current_s == parseInt(s*100) && current_b == parseInt(b*100)) return; 
    411655 
     
    418662                this.inputs.selector.style.left = x+"px"; 
    419663                this.inputs.selector.style.top = y+"px"; 
    420                  
     664 
    421665                this.inputs.currentColor.style.backgroundColor = color.asHex(); 
    422666 
     
    429673                var pos = Position.cumulativeOffset(this.inputs.background); 
    430674                var y = this.truncate(py - pos[1],0,255); 
    431                  
     675 
    432676                var h = (255-y)/255; 
    433677                var current_h = this.truncate(this.inputs.H.value,0,360); 
     
    500744                this.inputs.B.value = color.rgb.b; 
    501745                this.inputs.HEX.value = color.asHex().substring(1).toUpperCase(); 
    502                  
     746 
    503747                var images = Prado.WebUI.TColorPicker.UIImages; 
    504748 
    505749                var changeCss = color.isBright() ? 'removeClassName' : 'addClassName'; 
    506750                Element[changeCss](this.inputs.selector, 'target_white'); 
    507                  
     751 
    508752                if(update) 
    509753                        this.updateSelectors(color); 
     
    514758                var hsb = color.asHSB(); 
    515759                var pos = [hsb.s*255, hsb.b*255, hsb.h*255]; 
    516                  
     760 
    517761                this.inputs.selector.style.left = this.truncate(pos[0],0,255)+"px"; 
    518762                this.inputs.selector.style.top = this.truncate(255-pos[1],0,255)+"px"; 
    519763                this.inputs.slider.style.top = this.truncate(255-pos[2],0,255)+"px"; 
    520