diff --git a/catppuccin-theme.el b/catppuccin-theme.el index 3692c8c..6e57173 100644 --- a/catppuccin-theme.el +++ b/catppuccin-theme.el @@ -43,6 +43,8 @@ ;;; Code: +(eval-when-compile (require 'subr-x)) + (deftheme catppuccin) ;;; Configuration options: @@ -239,6 +241,15 @@ FLAVOR defaults to the value of `catppuccin-flavor'." (defalias 'catppuccin-get-color 'catppuccin-color) +(defun catppuccin-insert-color (color &optional flavor) + "Insert COLOR at point." + (interactive "SColor: ") + (let ((color (catppuccin-color color flavor))) + (insert + (if (char-equal (char-before) ?#) + (string-remove-prefix "#" color) + color)))) + ;;; Theme definition: (let