# HG changeset patch # User Zachary Kanfer # Date 1507703158 14400 # Wed Oct 11 02:25:58 2017 -0400 # Node ID 03357d704e4cdabe55500673d1e022d57c569dcb # Parent af775eb87a1c854149bd68bc6b464f9f76facf93 allow the user to specify a background color for a slide. diff --git a/zpresent.el b/zpresent.el --- a/zpresent.el +++ b/zpresent.el @@ -101,10 +101,12 @@ (defvar zpresent-align-title 'left "How to align lines in the title. Possible values are 'left, 'right, 'center.") +(defvar zpresent-default-background-color "#E0E0E0" + "The default color placed over all fonts in the background.") ;;;; Faces: -(defface zpresent-whole-screen-face '((t . (:background "#E0E0E0"))) "Face that should be put over the whole screen.") +(defface zpresent-whole-screen-face `((t . (:background ,zpresent-default-background-color))) "Face that should be put over the whole screen.") (defface zpresent-base '((t . (:height 4.0 :foreground "#000000"))) "The base face, so we can manage changing sizes only by changing this face." :group 'zpresent-faces) (defface zpresent-h1 '((t . (:height 1.0 :inherit zpresent-base))) "Face for the title of a regular slide." :group 'zpresent-faces) (defface zpresent-title-slide-title '((t . (:height 1.5 :inherit zpresent-base))) "Face for titles in a title slide." :group 'zpresent-faces) @@ -605,6 +607,11 @@ (let ((inhibit-read-only t)) (insert (propertize (make-string (window-total-height) ?\n) 'face 'zpresent-base))) + (face-spec-set 'zpresent-whole-screen-face + `((t . (:background + ,(if-let ((background-color (alist-get "background-color" (gethash :properties slide) nil nil #'equal))) + background-color + zpresent-default-background-color))))) (move-overlay zpresent-whole-screen-overlay (point-min) (point-max))