This commit is contained in:
Kinneyzhang 2026-01-02 19:41:11 +08:00
parent 9a65f85fe8
commit 82c226e777
2 changed files with 17 additions and 7 deletions

View File

@ -388,7 +388,8 @@
(defvar tp-palette-org-tag
'(:fg ("#57606a" . "#8b949e") :bg ("#f6f8fa" . "#21262d")
:border ("#d0d7de" . "#30363d"))
:border ("#d0d7de" . "#888"))
;; #30363d
"Org 标签样式。")
;; ============================================
@ -750,6 +751,8 @@
SYMBOL should be a symbol bound to a palette plist.
KEY should be one of :fg, :bg, or :border.
Returns nil if SYMBOL is unbound or doesn't contain KEY."
(setq symbol (intern (concat "tp-palette-"
(symbol-name symbol))))
(when (and (symbolp symbol) (boundp symbol))
(let ((plist (symbol-value symbol)))
(when (plistp plist)

19
tp.el
View File

@ -3904,12 +3904,19 @@ e.g.3 (tp-parse-color '(:light \"red\" :dark \"green\"))"
;;; Built-in text properties
(define-tp tp-palette (symbol)
(let ((palette (intern (concat "tp-palette-"
(symbol-name symbol)))))
`(face ( :foreground ,(tp-palette-fg-color palette)
:background ,(tp-palette-bg-color palette)
:box (:color ,(tp-palette-border-color palette))))))
(define-tp tp-palette (palette)
`(face (,@(when-let ((color (tp-palette-fg-color palette)))
`(:foreground ,color))
,@(when-let ((color (tp-palette-bg-color palette)))
`(:background ,color))
,@(when-let ((color (tp-palette-border-color palette)))
`(:box (:color ,color))))))
(define-tp tp-fg (color)
`(face (:foreground ,color)))
(define-tp tp-bg (color)
`(face (:background ,color)))
(define-tp tp-button (plist)
(let ((palette (plist-get plist :palette))