Skip to content

Instantly share code, notes, and snippets.

@rbanffy
Created May 12, 2017 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbanffy/b678fbb13c2cb876b142c45b4fdecb38 to your computer and use it in GitHub Desktop.
Save rbanffy/b678fbb13c2cb876b142c45b4fdecb38 to your computer and use it in GitHub Desktop.
Redshift for Emacs
(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