daviwil / emacs-from-hell

⚠️ The most dangerous init.el ⚠️
18 stars 0 forks source link

Color ideas #2

Open duckwork opened 2 years ago

duckwork commented 2 years ago
(defun random-color ()
  (let ((red (random 256))
        (blue (random 256))
        (green (random 256)))
    (format "#%02x%02x%02x" red blue green)))

(defun random-color-face (&optional face frame)
  (set-face-attribute face frame :foreground (random-color) :background (random-color)))

(add-hook 'post-command-hook 'random-color-face)
duckwork commented 2 years ago

SH----- I Forgot

(defun random-color ()
  (let ((red (random 256))
        (blue (random 256))
        (green (random 256)))
    (format "#%02x%02x%02x" red blue green)))

(defun random-color-face (&optional face frame)
  (setq face (or face 'default))
  (set-face-attribute face frame :foreground (random-color) :background (random-color)))

(add-hook 'post-command-hook 'random-color-face)