Skip to content

add ability to setq, and statically define the particle color #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
12 changes: 11 additions & 1 deletion power-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ Set to nil to disable shake effects."
:type '(choice integer (const nil))
:group 'power)

(defcustom power-mode-streak-static-particle-color
nil
"User-defined static streak particle color.

If nil, the dynamic foreground text color is used."
:type '(choice color (const nil))
:group 'power)

(defcustom power-mode-streak-particle-threshold
20
"Streak required before particle effects activate.
Expand Down Expand Up @@ -268,6 +276,8 @@ Set to nil to disable particle effects."

(defun power-mode--foreground-color-before-point ()
"Get the foreground color of the character before the point."
(if power-mode-streak-static-particle-color
power-mode-streak-static-particle-color
(let ((mode hl-line-mode)
(global-mode global-hl-line-mode))
(hl-line-mode -1)
Expand All @@ -278,7 +288,7 @@ Set to nil to disable particle effects."
(let ((color (foreground-color-at-point)))
(hl-line-mode mode)
(global-hl-line-mode global-mode)
color))))
color)))))

(defun power-mode--spawn-particles-at-point ()
"Spawn particles at the point."
Expand Down