X-Git-Url: http://git.kpe.io/?p=wol.git;a=blobdiff_plain;f=color-picker.lisp;h=4b942b8d6cf2384015a6fbe71ee3d21b3ac74d34;hp=2122e9e46de9974eb183a66d7154e2bdf17a907e;hb=HEAD;hpb=d91ff3b4d9cdcae003420c04609ea736161c7e65 diff --git a/color-picker.lisp b/color-picker.lisp index 2122e9e..4b942b8 100644 --- a/color-picker.lisp +++ b/color-picker.lisp @@ -1,3 +1,5 @@ +(in-package #:wol) + (defun luminance (r g b) (+ (* r 0.299) (* g 0.587) (* b 0.114))) @@ -5,14 +7,14 @@ (flet ((color-td (r g b) (let ((color (format nil "#~2,'0x~2,'0x~2,'0x" r g b))) (html ((:td :bgcolor color - :fformat (:onclick "f42('~a');" - color))"   "))))) + :fformat (:onclick "f42('~a');" + color))"   "))))) (let* ((colors nil)) (dotimes (r 6) (dotimes (g 6) (dotimes (b 6) (push (list (* r 51) (* g 51) (* b 51)(luminance r g b)) - colors)))) + colors)))) (setf colors (sort colors #'> :key 'fourth)) (html (:head @@ -42,5 +44,5 @@ f42(d){window.opener.change_color(d);window.close();};") :br ((:div :align "center") ((:a :class "call" :href "javascript:window.close();") - "Close"))))))) + "Close")))))))