Created
May 12, 2017 16:38
-
-
Save rbanffy/b678fbb13c2cb876b142c45b4fdecb38 to your computer and use it in GitHub Desktop.
Redshift for Emacs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun sunset (color) | |
"Redshifts the #RRGGBB COLOR." | |
(let ((rgb | |
(mapcar | |
(lambda (x) (string-to-number x 16)) | |
(list | |
(substring color 1 3) | |
(substring color 3 5) | |
(substring color 5 7))))) | |
(concat | |
"#" (apply 'concat | |
(mapcar | |
(lambda (x) (format "%x" x)) | |
(list | |
(nth 0 rgb) | |
(* (nth 1 rgb) .75) | |
(* (nth 2 rgb) .75))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment