;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/lights.el ;; ;; lights: ;; https://dataswamp.org/~incal/data/LIGHTS (defun illumination-score (w lm) (interactive "nW: \nnlm: ") (let*((le (/ lm w 1.0)) (max 75) ; LED luminous efficacy (lm/W) (min 15) ; incandescent ditto (scale (- max min)) (score (* 100 (/ (- le min) scale)) )) (format "%.0f%%" score) )) (when nil (illumination-score (+ (* 2 1) (* 2 2.8) 8 7) ; 22.6 W (+ (* 2 120) 500 525) ; 1265 lm ) ; 68% ) (provide 'lights)