gnome/extensions/workspaces-to-dock@passingthru67.gmail.com/dockedWorkspaces.js
// update background opacity based on preferences
update background opacity based on preferences
update background opacity based on preferences
_updateBackgroundOpacity() {
        let [backgroundColor, borderColor] = this._getBackgroundColor();
        if (backgroundColor) {
            let backgroundAlpha = Math.max(Math.round(backgroundColor.alpha/2.55)/100, .001);
            let newAlpha = this._settings.get_double('background-opacity');
            this._defaultBackground = "rgba(" + backgroundColor.red + "," + backgroundColor.green + "," + backgroundColor.blue + "," + backgroundAlpha + ")";
            this._customBackground = "rgba(" + backgroundColor.red + "," + backgroundColor.green + "," + backgroundColor.blue + "," + newAlpha + ")";
            if (borderColor) {
                let borderAlpha = Math.round(borderColor.alpha/2.55)/100;
                borderAlpha = Math.min((borderAlpha/backgroundAlpha)*newAlpha, 1);
                this._defaultBorder = "rgba(" + borderColor.red + "," + borderColor.green + "," + borderColor.blue + "," + Math.round(borderColor.alpha/2.55)/100 + ")";
                this._customBorder = "rgba(" + borderColor.red + "," + borderColor.green + "," + borderColor.blue + "," + borderAlpha + ")";
            }
            if (this._settings.get_boolean('opaque-background')) {
                this._fadeInBackground(this._settings.get_double('animation-time'), 0);
            } else {
                this._fadeOutBackground(this._settings.get_double('animation-time'), 0);
            }
        }
    }
_updateBackgroundOpacity ( ) { let [ backgroundColor , borderColor ] = this . _getBackgroundColor ( ) ; if ( backgroundColor ) { let backgroundAlpha = Math . max ( Math . round ( backgroundColor . alpha / 2.55 ) / 100 , .001 ) ; let newAlpha = this . _settings . get_double ( 'background-opacity' ) ; this . _defaultBackground = "rgba(" + backgroundColor . red + "," + backgroundColor . green + "," + backgroundColor . blue + "," + backgroundAlpha + ")" ; this . _customBackground = "rgba(" + backgroundColor . red + "," + backgroundColor . green + "," + backgroundColor . blue + "," + newAlpha + ")" ; if ( borderColor ) { let borderAlpha = Math . round ( borderColor . alpha / 2.55 ) / 100 ; borderAlpha = Math . min ( ( borderAlpha / backgroundAlpha ) * newAlpha , 1 ) ; this . _defaultBorder = "rgba(" + borderColor . red + "," + borderColor . green + "," + borderColor . blue + "," + Math . round ( borderColor . alpha / 2.55 ) / 100 + ")" ; this . _customBorder = "rgba(" + borderColor . red + "," + borderColor . green + "," + borderColor . blue + "," + borderAlpha + ")" ; } if ( this . _settings . get_boolean ( 'opaque-background' ) ) { this . _fadeInBackground ( this . _settings . get_double ( 'animation-time' ) , 0 ) ; } else { this . _fadeOutBackground ( this . _settings . get_double ( 'animation-time' ) , 0 ) ; } } }
update background opacity based on preferences
update background opacity based on preferences
// We check the background alpha for a minimum of .001 to prevent // division by 0 errors when calculating borderAlpha later // The border and background alphas should remain in sync // We also limit the borderAlpha to a maximum of 1 (full opacity)