emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/beardbolt 5324775417 321/323: Add beardbolt-shuffle-rai


From: ELPA Syncer
Subject: [elpa] externals/beardbolt 5324775417 321/323: Add beardbolt-shuffle-rainbow option
Date: Thu, 9 Mar 2023 10:59:00 -0500 (EST)

branch: externals/beardbolt
commit 53247754177399dc32681c17f545f575fe2a31ae
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Add beardbolt-shuffle-rainbow option
    
    * README.md: Mention change.
    
    * beardbolt.el (bb-shuffle-rainbow): New option.
    (bb--rainbowize): Use it.
---
 README.md    | 3 +++
 beardbolt.el | 9 ++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 028faedd06..6d1a8a5f98 100644
--- a/README.md
+++ b/README.md
@@ -93,6 +93,9 @@ Beardbolt will pick them up immediately on each run.
 * `beardbolt-ccj-extra-flags`: A string of extra compilation flags to
   append to the compilation command devined from
   `compile_commands.json`.
+  
+* `beardbolt-shuffle-rainbow`: Use less pretty rainbow colors, but
+  potentially more useful and contrasting ones.
 
 <a name="benchmarks"></a>
 ### Benchmarks vs RMSbolt
diff --git a/beardbolt.el b/beardbolt.el
index 0e87ac733f..675ec33597 100644
--- a/beardbolt.el
+++ b/beardbolt.el
@@ -77,6 +77,9 @@ Passed directly to compiler or disassembler."
 (bb--defoption bb-ccj-extra-flags nil
   "Extra flags for compilation command devined from compile_commands.json."
   :type 'string :safe (lambda (v) (or (null v) (stringp v))))
+(bb--defoption bb-shuffle-rainbow nil
+  "Choose less pretty, but potentially more contrasting rainbow colors."
+  :type 'boolean :safe 'booleanp)
 
 (defface bb-current-line-face
   '((t (:weight bold :inherit highlight)))
@@ -444,6 +447,7 @@ some parts of the buffer and setup a buffer-local value of
          all-ovs
          (idx 0)
          total
+         (shuffle (buffer-local-value 'bb-shuffle-rainbow src-buffer))
          (ht (make-hash-table)))
     (cl-loop initially (goto-char (point-min))
              with current-line = 1
@@ -465,8 +469,11 @@ some parts of the buffer and setup a buffer-local value of
      (lambda (src-line asm-pos-regions)
        (when (not (zerop src-line))
          (cl-loop
+          with i = (if shuffle
+                       (mod (* 27 (cl-incf idx)) total)
+                     (cl-incf idx))
           with bright-hsl =(list (mod (+ (cl-first background-hsl)
-                                         (/ (cl-incf idx) (float total)))
+                                         (/ i (float total)))
                                       1)
                                  (min (max (cl-second background-hsl)
                                            0.25)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]