[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: still blue



Thomas Schmitt wrote:

> # Minimum brightness for blue to be perceivable
> blue_base=64
>
> # Minimum advantage of blue over (red + green)/2
> blue_advantage=64

Thanks a lot, this is what I had in mind exactly!

Is this a correct implementation?

(defalias '** #'expt)

(defun blue-p (r g b)
  (let*((min-adv (** 2 6))
        (rg      (ceiling (/ (+ r g) 2.0)))
        (diff    (- b rg)) )
    (<= min-adv diff) ))

;; (blue-p   0   0  64) ; t
;; (blue-p   1   0  64) ; nil
;; (blue-p 191 191 255) ; t
;; (blue-p 191 192 255) ; nil

-- 
underground experts united
https://dataswamp.org/~incal


Reply to: