;;; -*- lexical-binding: t -*- ;; -------------------------------------------------------------------------- (require 'cl-lib) (cl-pushnew "." load-path :test #'string=) (require 'luki-lisp) ;; -------------------------------------------------------------------------- (defun bad-alpha-say () (let* ((a (bad-alpha-get))) (when (n a) ($ "opaque: %d%%" (floor (* 100 a)))))) ;; -------------------------------------------------------------------------- (defun bad-alpha-get () (frame-parameter nil 'alpha-background)) (defun bad-alpha-set (&optional alpha) (or alpha (setq alpha 0.6)) (setq alpha (min 1.0 (max 0.0 alpha))) (set-frame-parameter nil 'alpha-background alpha) (bad-alpha-say)) ;; -------------------------------------------------------------------------- (defun bad-alpha-none () (bad-alpha-set 1.0)) (defun bad-alpha-more (&optional inc less) (or inc (setq inc 0.1)) (when less (setq inc (* -1 inc))) (let* ((bg (or (bad-alpha-get) (& (bad-alpha-set 1.0) (bad-alpha-get)))) (bg-new (+ inc bg))) (bad-alpha-set bg-new))) (defun bad-alpha-less (&optional dec) (bad-alpha-more dec t)) ;; -------------------------------------------------------------------------- (<- 'bad-alpha)