Last active
May 13, 2017 06:30
-
-
Save lispm/7e1c3f4043b31db44c22fd9204fc290b to your computer and use it in GitHub Desktop.
This file contains hidden or 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 &key (shift-list '(1 4/3 4/3))) | |
"Redshifts the #RRGGBB color." | |
(format nil | |
"#~{~X~}" | |
(loop for start in '(1 3 5) and shift in shift-list | |
collect (truncate (parse-integer color | |
:start start | |
:end (+ start 2) | |
:radix 16) | |
shift)))) | |
(defun sunset (color &key (shift-list '(1 4/3 4/3))) | |
"Redshifts the #RRGGBB color." | |
(format nil | |
"#~{~X~}" | |
(mapcar (lambda (start shift) | |
(truncate (parse-integer color :start start :end (+ start 2) :radix 16) | |
shift)) | |
'(1 3 5) | |
shift-list))) | |
; (sunset "#AABBCC" :shift-list '(1 3/2 4/3)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment