emacs-widgetで色の選択。
16進6桁の値を入力しているとそれに対応した色に"target:"の文字の色がリアルタイムで変化。
(defface asc:target-face '((t (:foreground "white" :background "#0080ff" :italic nil :bold t))) "face for selected by mouse") (defvar asc:target-face 'asc:target-face) (defun active-select-color () (interactive) (insert (propertize "target:\n" 'face asc:target-face)) (widget-create 'editable-field :size 6 :value "ffffff" :notify (lambda (w &rest ignore) (let1 color (format "#%s" (widget-value w)) (message "edit %s" color) (when (string-match "^#[0-9abcdef]\\{6\\}$" color) (set-face-attribute asc:target-face nil :background color))))) (widget-setup))