emacs/var/elfeed/db/data/4b/4b52675c8d7a76380e737f8ab51f15ace1033110
2022-01-03 12:49:32 -06:00

1 line
2.4 KiB
Plaintext

<!-- SC_OFF --><div class="md"><p>One of my favorite parts of Org-mode is the customizable colored headers; personally, it makes me extremely motivated to work and makes Org-mode so much more beautiful. Here&#39;s a quick script I made to make changing those colors easier, and hopefully, someone finds this helpful!</p> <p>&#x200B;</p> <ol> <li>First, generate a palette you like from this color palette generator: <a href="https://coolors.co">https://coolors.co</a></li> <li>Copy the RGB color codes, separated by hyphens, from the url</li> <li>Paste it into the list in the same format as I have in the below code snippet</li> <li>Copy the code into your init file somewhere</li> </ol> <p>Essentially, the code splits the string into a list of codes, then the face attributes set the org header colors to the corresponding list colors.</p> <p>I&#39;d like to turn this into a package one day, but that&#39;s a project for another time (or if someone wants to help me, I&#39;d love to work with them). And finally, if anyone uses this, drop your color palettes below!</p> <p>&#x200B;</p> <pre><code> (defun col-strip (col-str) (butlast (split-string (mapconcat (lambda (x) (concat &quot;#&quot; x &quot; &quot;)) (split-string col-str &quot;-&quot;) &quot;&quot;) &quot; &quot;))) (setq color-schemes (list (col-strip &quot;a21d1d-5497de-8e35b7-ffff5b-56cb7d-df5252-707efa&quot;) ; red blue purple study (col-strip &quot;2278bf-e15554-3bb273-507c6d-6e5775-598d91-7768ae&quot;) ; blue red green okay )) (setq pick-color 0) (setq color-theme (nth pick-color color-schemes)) (set-face-attribute &#39;org-level-1 nil :height 1.3 :foreground (nth 0 color-theme)) (set-face-attribute &#39;org-level-2 nil :height 1.2 :foreground (nth 1 color-theme)) (set-face-attribute &#39;org-level-3 nil :height 1.1 :foreground (nth 2 color-theme)) (set-face-attribute &#39;org-level-4 nil :height 1.05 :foreground (nth 3 color-theme)) (set-face-attribute &#39;org-level-5 nil :foreground (nth 4 color-theme)) (set-face-attribute &#39;org-level-6 nil :foreground (nth 5 color-theme)) </code></pre> </div><!-- SC_ON --> &#32; submitted by &#32; <a href="https://www.reddit.com/user/Pr0Thr0waway"> /u/Pr0Thr0waway </a> <br/> <span><a href="https://www.reddit.com/r/emacs/comments/rg9ojl/a_workflow_to_quickly_change_orgmode_section/">[link]</a></span> &#32; <span><a href="https://www.reddit.com/r/emacs/comments/rg9ojl/a_workflow_to_quickly_change_orgmode_section/">[comments]</a></span>