1 line
2.4 KiB
Plaintext
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's a quick script I made to make changing those colors easier, and hopefully, someone finds this helpful!</p> <p>​</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'd like to turn this into a package one day, but that's a project for another time (or if someone wants to help me, I'd love to work with them). And finally, if anyone uses this, drop your color palettes below!</p> <p>​</p> <pre><code> (defun col-strip (col-str) (butlast (split-string (mapconcat (lambda (x) (concat "#" x " ")) (split-string col-str "-") "") " "))) (setq color-schemes (list (col-strip "a21d1d-5497de-8e35b7-ffff5b-56cb7d-df5252-707efa") ; red blue purple study (col-strip "2278bf-e15554-3bb273-507c6d-6e5775-598d91-7768ae") ; blue red green okay )) (setq pick-color 0) (setq color-theme (nth pick-color color-schemes)) (set-face-attribute 'org-level-1 nil :height 1.3 :foreground (nth 0 color-theme)) (set-face-attribute 'org-level-2 nil :height 1.2 :foreground (nth 1 color-theme)) (set-face-attribute 'org-level-3 nil :height 1.1 :foreground (nth 2 color-theme)) (set-face-attribute 'org-level-4 nil :height 1.05 :foreground (nth 3 color-theme)) (set-face-attribute 'org-level-5 nil :foreground (nth 4 color-theme)) (set-face-attribute 'org-level-6 nil :foreground (nth 5 color-theme)) </code></pre> </div><!-- SC_ON -->   submitted by   <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>   <span><a href="https://www.reddit.com/r/emacs/comments/rg9ojl/a_workflow_to_quickly_change_orgmode_section/">[comments]</a></span> |