   "Increase transparency for FRAME.
 If FRAME is nil, it defaults to the selected frame."
   (interactive)
-  (let* ((frame-alpha-pair (frame-parameter frame 'alpha))
-         (current-alpha (if frame-alpha-pair (car frame-alpha-pair) 100))
+  (let* ((current-alpha (or (car (frame-parameter frame 'alpha)) 100))
          (increased-alpha (- current-alpha 5)))
     (when (>= increased-alpha frame-alpha-lower-limit)
       (set-frame-parameter frame 'alpha

  "Toggle between transparent and opaque state for FRAME.
If FRAME is nil, it defaults to the selected frame."
  (interactive)
  (let* ((alpha (frame-parameter frame 'alpha))
         (dotfile-setting (cons dotspacemacs-active-transparency
                                dotspacemacs-inactive-transparency)))
    (set-frame-parameter
     frame 'alpha
     (if (not (equal alpha dotfile-setting))
         dotfile-setting
       '(100 . 100)))))

(defun spacemacs/enable-transparency (&optional frame)
  "Enable transparent and opaque state for FRAME.
If FRAME is nil, it defaults to the selected frame."
  (interactive)
  (let* ((dotfile-setting (cons dotspacemacs-active-transparency
                                dotspacemacs-inactive-transparency)))
    (set-frame-parameter frame 'alpha dotfile-setting)))

(defun spacemacs/disable-transparency (&optional frame)
  "Disable transparent and opaque state for FRAME.
If FRAME is nil, it defaults to the selected frame."
  (interactive)
  (set-frame-parameter frame 'alpha '(100 . 100)))

  "Decrease transparency for FRAME.
If FRAME is nil, it defaults to the selected frame."
  (interactive)
  (let* ((current-alpha (or (car (frame-parameter frame 'alpha)) 100))
         (decreased-alpha (+ current-alpha 5)))
    (when (<= decreased-alpha 100)
      (set-frame-parameter frame 'alpha
