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 Oct 16, 2024
1 parent df96a25 commit fb1bf9e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions catppuccin-theme.el
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@

;;; Code:

(eval-when-compile (require 'subr-x))

(deftheme catppuccin)

;;; Configuration options:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fb1bf9e

Please sign in to comment.