Skip to content

Commit

Permalink
feat: add function catppuccin-insert-color
Browse files Browse the repository at this point in the history
  • Loading branch information
jtbx committed Sep 28, 2024
1 parent fe83fa1 commit 48afc06
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions catppuccin-theme.el
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,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
Expand Down

0 comments on commit 48afc06

Please sign in to comment.