home *** CD-ROM | disk | FTP | other *** search
- var g_fPolling=false;
- var g_kPaintSpeed=33;
-
- function StartPolling()
- {
- g_fPolling=true;
- UpdateSliders();
- timerTxt.moveTo(timerTxt.left,timerTxt.top,g_kPaintSpeed);
- }
-
- function StopPolling()
- {
- g_fPolling=false;
- }
-
- function UpdateSliders()
- {
- var newback = actualFromSlider(backhueslider.value);
- mediacenter.backHueShift = newback;
- mediacenter.backSaturation = backsatslider.value;
-
- var newbuttonsat = (180-Math.abs(backhueslider.value)) / 180;
- newbuttonsat = Math.min(newbuttonsat, mediacenter.backSaturation);
- mediacenter.buttonSaturation=newbuttonsat;
- }
-
- function sliderFromActual(actualVal)
- {
- return (actualVal<=180) ? actualVal : (actualVal-360);
- }
-
- function actualFromSlider(sliderVal)
- {
- return (sliderVal<0) ? (sliderVal+360) : sliderVal;
- }
-
- function ResetColors()
- {
- mediacenter.backHueShift=0;
- mediacenter.buttonHueShift=0;
- mediacenter.backSaturation=1;
- mediacenter.buttonSaturation=1;
- helper.clearColors();
- }
-
- function ColorSetting(hue,sat)
- {
- this.hue=hue;
- this.sat=sat;
- }
-
- var g_rgColorPresets = new Array
- (
- //====================================================================
- /* HUE SATURATION || TITLE */
- //====================================================================
- new ColorSetting(0, 1), // defaultblue
- new ColorSetting(330, 0.491124272346497), // teal_new
- new ColorSetting(330, 1), // teal_current
- new ColorSetting(300, 0.491124272346497), // seagreen_new
- new ColorSetting(300, 1), // seagreen_current
- new ColorSetting(240, 0.491124272346497), // green_new
- new ColorSetting(240, 1), // green_current
- new ColorSetting(210, 0.491124272346497), // xpolive
- new ColorSetting(210, 1), // olive_current
- new ColorSetting(180, 0.272189348936081), // putty
- new ColorSetting(180, 1), // brown_current
- new ColorSetting(171.48, 1.84), // orange
- new ColorSetting(150, 0.491124272346497), // bronze_new
- new ColorSetting(150, 1), // bronze_current
- new ColorSetting(120, 1), // red_current
- new ColorSetting(90, 1), // magenta_current
- new ColorSetting(60, 0.461538463830948), // violet_new
- new ColorSetting(60, 1), // violet_current
- new ColorSetting(30, 0.467455625534058), // purple_new
- new ColorSetting(30, 1.0), // purple_current
- new ColorSetting(0, 0.0), // grey
- new ColorSetting(0, 0.272189348936081), // xpsilver
- new ColorSetting(0, 0.491124272346497) // blue
- );
-
- var g_nCurrentColorPreset=parseInt(theme.loadPreference("CurrentColorPreset"));
-
- function CycleColors(interval)
- {
- if ( isNaN( g_nCurrentColorPreset ) )
- {
- g_nCurrentColorPreset=0;
- }
- else
- {
- g_nCurrentColorPreset = (g_nCurrentColorPreset+interval)%g_rgColorPresets.length;
- }
- mediacenter.backHueShift = g_rgColorPresets[g_nCurrentColorPreset].hue;
- mediacenter.backSaturation = g_rgColorPresets[g_nCurrentColorPreset].sat;
- }
-
- function SaveSettings()
- {
- if(false==isNaN(g_nCurrentColorPreset))
- {
- theme.savePreference('CurrentColorPreset',g_nCurrentColorPreset);
- }
- }
-