#+title: color-tools.el #+pubdate: <2021-01-05> #+draft: t This is a visualization page for functions used in the [[https://github.com/neeasade/color-tools.el][color-tools.el]] library. Some further context may be found here: [[https://notes.neeasade.net/color-spaces.html][reasoning about colors]] ** Iteration #+BEGIN_SRC elisp :results raw :exports results (defun ns/ct-visual (make kinds rate) (s-join "\n" (append (list (format "*** %s -- %s" (prin1-to-string make) (ns/blog-make-color-preview (funcall make rate rate rate) (prin1-to-string (list make rate rate rate))))) (-map (lambda (f) (format "\n%s\n\n%s" (ns/blog-make-color-strip (-map (lambda (val) (funcall f (funcall make rate rate rate) val)) (if (= ?h (string-to-char (reverse (prin1-to-string f)))) (range 0 361 30) (range 0 101 10)) )) (ns/blog-make-detail (format "(map '%s %s)" (prin1-to-string f) (if (= ?h (string-to-char (reverse (prin1-to-string f)))) '(range 0 361 30) '(range 0 101 10))) ))) kinds) ;; (list (ns/blog-make-hsep)) (list "\n\n") ))) (s-join "\n" (-flatten (-map (lambda (rate) (list (ns/ct-visual 'ct-make-hsl '(ct-edit-hsl-h ct-edit-hsl-s ct-edit-hsl-l) rate) (ns/ct-visual 'ct-make-hsv '(ct-edit-hsv-h ct-edit-hsv-s ct-edit-hsv-v) rate) (ns/ct-visual 'ct-make-hsluv '(ct-edit-hsluv-h ct-edit-hsluv-s ct-edit-hsluv-l) rate) (ns/ct-visual 'ct-make-hpluv '(ct-edit-hpluv-h ct-edit-hpluv-p ct-edit-hpluv-l) rate) (ns/ct-visual 'ct-make-lab '(ct-edit-lab-l ct-edit-lab-a ct-edit-lab-b) rate) (ns/ct-visual 'ct-make-lch '(ct-edit-lch-l ct-edit-lch-c ct-edit-lch-h) rate))) '(40 60)))) #+end_src ** Hue rotation #+BEGIN_SRC elisp :results raw :exports results (s-join "\n" (-flatten (-map (lambda (make) (format "*** %s\n%s" make (s-join "" (append (-map (lambda (degrees) (ns/blog-make-color-strip (funcall make ;; "#6486BB" (ct-make-hsluv 270 60 60) degrees))) '(180 120 90 72 60)) (list "45° turn:") (-map (lambda (degrees) (ns/blog-make-color-strip (funcall make ;; "#6486BB" (ct-make-hsluv (+ 270 45) 60 60) degrees))) '(180 120 90 72 60)) ))) ) '( ct-rotation-hsl ct-rotation-hsv ct-rotation-hsluv ct-rotation-hpluv ct-rotation-lch ) ) ) ) #+end_src