render() {
        document.body.style.margin = "0"
        document.body.style.padding = "0"

        var style = document.documentElement.style

        if (this.mode === "dark") { // Dark Mode

            style.setProperty('--gus-ui-color-primary', `${this.colorDark}`)
            style.setProperty('--gus-ui-color-primary-hover', `${this.pSBC(0.24, this.colorDark)}`)

            style.setProperty('--gus-ui-color-background', '#121212')
            style.setProperty('--gus-ui-color-background-hover', '#161616')

            style.setProperty('--gus-ui-color-surface', '#181818')
            style.setProperty('--gus-ui-color-surface-hover', '#202020')
            style.setProperty('--gus-ui-color-surface-focus', '#242424')
            style.setProperty('--gus-ui-color-surface-disabled', '#181818')

            style.setProperty('--gus-ui-color-error', '#CF6679')

            if (this.colorDark) {
                var primaryConstrastWithBlack = this.contrast(this.hexToRgb(this.colorDark), [0, 0, 0])
                var primaryConstrastWithWhite = this.contrast(this.hexToRgb(this.colorDark), [255, 255, 255])
    
                if (primaryConstrastWithBlack > primaryConstrastWithWhite) {
                    style.setProperty('--gus-ui-color-on-primary', '#000000')
                }
                else {
                    style.setProperty('--gus-ui-color-on-primary', '#FFFFFF')
                }
            }
            else {
                style.setProperty('--gus-ui-color-on-primary', '#FFFFFF')
            }

            style.setProperty('--gus-ui-color-on-secondary', '#000000')
            style.setProperty('--gus-ui-color-on-background', '#FFFFFF')
            style.setProperty('--gus-ui-color-on-surface', '#FFFFFF')
            style.setProperty('--gus-ui-color-on-surface-secondary', '#959595')
            style.setProperty('--gus-ui-color-on-surface-disabled', '#A5A5A5')

            style.setProperty('--gus-ui-color-on-error', '#000000')

            style.setProperty('--gus-ui-color-component-shadow', '0px 0px 0px grey')
            style.setProperty('--gus-ui-color-surface-shadow', '0px 0px 0px grey')

            style.setProperty('--gus-ui-color-white', '#FFFFFF')
            
        } else { // Light Mode

            style.setProperty('--gus-ui-color-primary', `${this.colorLight}`)
            style.setProperty('--gus-ui-color-primary-hover', `${this.pSBC(0.10, this.colorLight)}`)

            style.setProperty('--gus-ui-color-background', '#FFFFFF')
            style.setProperty('--gus-ui-color-background-hover', '#F5F5F5')

            style.setProperty('--gus-ui-color-surface', '#FFFFFF')
            style.setProperty('--gus-ui-color-surface-hover', '#F0F0F0')
            style.setProperty('--gus-ui-color-surface-focus', '#E4E4E4')
            style.setProperty('--gus-ui-color-surface-disabled', '#A5A5A5')

            style.setProperty('--gus-ui-color-error', '#B00020')

            if (this.colorLight) {
                var primaryConstrastWithBlack = this.contrast(this.hexToRgb(this.colorLight), [0, 0, 0])
                var primaryConstrastWithWhite = this.contrast(this.hexToRgb(this.colorLight), [255, 255, 255])
    
                if (primaryConstrastWithBlack > primaryConstrastWithWhite) {
                    style.setProperty('--gus-ui-color-on-primary', '#000000')
                }
                else {
                    style.setProperty('--gus-ui-color-on-primary', '#FFFFFF')
                }
            }
            else {
                style.setProperty('--gus-ui-color-on-primary', '#000000')
            }

            style.setProperty('--gus-ui-color-on-secondary', '#000000')
            style.setProperty('--gus-ui-color-on-background', '#000000')
            style.setProperty('--gus-ui-color-on-surface', '#000000')
            style.setProperty('--gus-ui-color-on-surface-secondary', '#959595')
            style.setProperty('--gus-ui-color-on-surface-disabled', '#A5A5A5')

            style.setProperty('--gus-ui-color-on-error', '#FFFFFF')

            style.setProperty('--gus-ui-color-component-shadow', '0px 1px 2px grey')
            style.setProperty('--gus-ui-color-surface-shadow', '0px 2px 4px grey')

            style.setProperty('--gus-ui-color-white', '#FFFFFF')
        }
    }
// Re-render the whole gus-ui
Re-render the whole gus-ui
Re - render the whole gus - ui
render() {
        document.body.style.margin = "0"
        document.body.style.padding = "0"
        var style = document.documentElement.style
        if (this.mode === "dark") { 
            style.setProperty('--gus-ui-color-primary', `${this.colorDark}`)
            style.setProperty('--gus-ui-color-primary-hover', `${this.pSBC(0.24, this.colorDark)}`)
            style.setProperty('--gus-ui-color-background', '#121212')
            style.setProperty('--gus-ui-color-background-hover', '#161616')
            style.setProperty('--gus-ui-color-surface', '#181818')
            style.setProperty('--gus-ui-color-surface-hover', '#202020')
            style.setProperty('--gus-ui-color-surface-focus', '#242424')
            style.setProperty('--gus-ui-color-surface-disabled', '#181818')
            style.setProperty('--gus-ui-color-error', '#CF6679')
            if (this.colorDark) {
                var primaryConstrastWithBlack = this.contrast(this.hexToRgb(this.colorDark), [0, 0, 0])
                var primaryConstrastWithWhite = this.contrast(this.hexToRgb(this.colorDark), [255, 255, 255])
                if (primaryConstrastWithBlack > primaryConstrastWithWhite) {
                    style.setProperty('--gus-ui-color-on-primary', '#000000')
                }
                else {
                    style.setProperty('--gus-ui-color-on-primary', '#FFFFFF')
                }
            }
            else {
                style.setProperty('--gus-ui-color-on-primary', '#FFFFFF')
            }
            style.setProperty('--gus-ui-color-on-secondary', '#000000')
            style.setProperty('--gus-ui-color-on-background', '#FFFFFF')
            style.setProperty('--gus-ui-color-on-surface', '#FFFFFF')
            style.setProperty('--gus-ui-color-on-surface-secondary', '#959595')
            style.setProperty('--gus-ui-color-on-surface-disabled', '#A5A5A5')
            style.setProperty('--gus-ui-color-on-error', '#000000')
            style.setProperty('--gus-ui-color-component-shadow', '0px 0px 0px grey')
            style.setProperty('--gus-ui-color-surface-shadow', '0px 0px 0px grey')
            style.setProperty('--gus-ui-color-white', '#FFFFFF')
        } else { 
            style.setProperty('--gus-ui-color-primary', `${this.colorLight}`)
            style.setProperty('--gus-ui-color-primary-hover', `${this.pSBC(0.10, this.colorLight)}`)
            style.setProperty('--gus-ui-color-background', '#FFFFFF')
            style.setProperty('--gus-ui-color-background-hover', '#F5F5F5')
            style.setProperty('--gus-ui-color-surface', '#FFFFFF')
            style.setProperty('--gus-ui-color-surface-hover', '#F0F0F0')
            style.setProperty('--gus-ui-color-surface-focus', '#E4E4E4')
            style.setProperty('--gus-ui-color-surface-disabled', '#A5A5A5')
            style.setProperty('--gus-ui-color-error', '#B00020')
            if (this.colorLight) {
                var primaryConstrastWithBlack = this.contrast(this.hexToRgb(this.colorLight), [0, 0, 0])
                var primaryConstrastWithWhite = this.contrast(this.hexToRgb(this.colorLight), [255, 255, 255])
                if (primaryConstrastWithBlack > primaryConstrastWithWhite) {
                    style.setProperty('--gus-ui-color-on-primary', '#000000')
                }
                else {
                    style.setProperty('--gus-ui-color-on-primary', '#FFFFFF')
                }
            }
            else {
                style.setProperty('--gus-ui-color-on-primary', '#000000')
            }
            style.setProperty('--gus-ui-color-on-secondary', '#000000')
            style.setProperty('--gus-ui-color-on-background', '#000000')
            style.setProperty('--gus-ui-color-on-surface', '#000000')
            style.setProperty('--gus-ui-color-on-surface-secondary', '#959595')
            style.setProperty('--gus-ui-color-on-surface-disabled', '#A5A5A5')
            style.setProperty('--gus-ui-color-on-error', '#FFFFFF')
            style.setProperty('--gus-ui-color-component-shadow', '0px 1px 2px grey')
            style.setProperty('--gus-ui-color-surface-shadow', '0px 2px 4px grey')
            style.setProperty('--gus-ui-color-white', '#FFFFFF')
        }
    }
render ( ) { document . body . style . margin = "0" document . body . style . padding = "0" var style = document . documentElement . style if ( this . mode === "dark" ) { style . setProperty ( '--gus-ui-color-primary' , ` ${ this . colorDark } ` ) style . setProperty ( '--gus-ui-color-primary-hover' , ` ${ this . pSBC ( 0.24 , this . colorDark ) } ` ) style . setProperty ( '--gus-ui-color-background' , '#121212' ) style . setProperty ( '--gus-ui-color-background-hover' , '#161616' ) style . setProperty ( '--gus-ui-color-surface' , '#181818' ) style . setProperty ( '--gus-ui-color-surface-hover' , '#202020' ) style . setProperty ( '--gus-ui-color-surface-focus' , '#242424' ) style . setProperty ( '--gus-ui-color-surface-disabled' , '#181818' ) style . setProperty ( '--gus-ui-color-error' , '#CF6679' ) if ( this . colorDark ) { var primaryConstrastWithBlack = this . contrast ( this . hexToRgb ( this . colorDark ) , [ 0 , 0 , 0 ] ) var primaryConstrastWithWhite = this . contrast ( this . hexToRgb ( this . colorDark ) , [ 255 , 255 , 255 ] ) if ( primaryConstrastWithBlack > primaryConstrastWithWhite ) { style . setProperty ( '--gus-ui-color-on-primary' , '#000000' ) } else { style . setProperty ( '--gus-ui-color-on-primary' , '#FFFFFF' ) } } else { style . setProperty ( '--gus-ui-color-on-primary' , '#FFFFFF' ) } style . setProperty ( '--gus-ui-color-on-secondary' , '#000000' ) style . setProperty ( '--gus-ui-color-on-background' , '#FFFFFF' ) style . setProperty ( '--gus-ui-color-on-surface' , '#FFFFFF' ) style . setProperty ( '--gus-ui-color-on-surface-secondary' , '#959595' ) style . setProperty ( '--gus-ui-color-on-surface-disabled' , '#A5A5A5' ) style . setProperty ( '--gus-ui-color-on-error' , '#000000' ) style . setProperty ( '--gus-ui-color-component-shadow' , '0px 0px 0px grey' ) style . setProperty ( '--gus-ui-color-surface-shadow' , '0px 0px 0px grey' ) style . setProperty ( '--gus-ui-color-white' , '#FFFFFF' ) } else { style . setProperty ( '--gus-ui-color-primary' , ` ${ this . colorLight } ` ) style . setProperty ( '--gus-ui-color-primary-hover' , ` ${ this . pSBC ( 0.10 , this . colorLight ) } ` ) style . setProperty ( '--gus-ui-color-background' , '#FFFFFF' ) style . setProperty ( '--gus-ui-color-background-hover' , '#F5F5F5' ) style . setProperty ( '--gus-ui-color-surface' , '#FFFFFF' ) style . setProperty ( '--gus-ui-color-surface-hover' , '#F0F0F0' ) style . setProperty ( '--gus-ui-color-surface-focus' , '#E4E4E4' ) style . setProperty ( '--gus-ui-color-surface-disabled' , '#A5A5A5' ) style . setProperty ( '--gus-ui-color-error' , '#B00020' ) if ( this . colorLight ) { var primaryConstrastWithBlack = this . contrast ( this . hexToRgb ( this . colorLight ) , [ 0 , 0 , 0 ] ) var primaryConstrastWithWhite = this . contrast ( this . hexToRgb ( this . colorLight ) , [ 255 , 255 , 255 ] ) if ( primaryConstrastWithBlack > primaryConstrastWithWhite ) { style . setProperty ( '--gus-ui-color-on-primary' , '#000000' ) } else { style . setProperty ( '--gus-ui-color-on-primary' , '#FFFFFF' ) } } else { style . setProperty ( '--gus-ui-color-on-primary' , '#000000' ) } style . setProperty ( '--gus-ui-color-on-secondary' , '#000000' ) style . setProperty ( '--gus-ui-color-on-background' , '#000000' ) style . setProperty ( '--gus-ui-color-on-surface' , '#000000' ) style . setProperty ( '--gus-ui-color-on-surface-secondary' , '#959595' ) style . setProperty ( '--gus-ui-color-on-surface-disabled' , '#A5A5A5' ) style . setProperty ( '--gus-ui-color-on-error' , '#FFFFFF' ) style . setProperty ( '--gus-ui-color-component-shadow' , '0px 1px 2px grey' ) style . setProperty ( '--gus-ui-color-surface-shadow' , '0px 2px 4px grey' ) style . setProperty ( '--gus-ui-color-white' , '#FFFFFF' ) } }
Re-render the whole gus-ui
Re - render the whole gus - ui
// Dark Mode // Light Mode