Function: erc-nicks-ensaturate

erc-nicks-ensaturate is a byte-compiled function defined in erc-nicks.el.gz.

Signature

(erc-nicks-ensaturate COLOR)

Documentation

Ensure COLOR falls within erc-nicks-saturation-range.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-nicks.el.gz
(defun erc-nicks-ensaturate (color)
  "Ensure COLOR falls within `erc-nicks-saturation-range'."
  (pcase-let ((`(,min . ,max) erc-nicks-saturation-range)
              (`(,h ,s ,l) (apply #'color-rgb-to-hsl color)))
    (cond ((> s max) (setq color (color-hsl-to-rgb h max l)))
          ((< s min) (setq color (color-hsl-to-rgb h min l)))))
  color)