Function: eca-completion--dim-fontified
eca-completion--dim-fontified is a natively compiled function defined
in eca-completion.el.
Signature
(eca-completion--dim-fontified TEXT BG RATIO)
Documentation
Return a copy of TEXT with each face span's foreground dimmed.
TEXT is expected to already carry font-lock face properties.
Each span's resolved foreground (falling back to the default
face's foreground) is blended toward BG by RATIO via
eca-completion--blend-color, and the result is layered on the
span as a higher-priority anonymous face so the original
font-lock face still contributes its non-color attributes.
Spans whose colors cannot be resolved are left untouched.
Source Code
;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-completion.el
(defun eca-completion--dim-fontified (text bg ratio)
"Return a copy of TEXT with each face span's foreground dimmed.
TEXT is expected to already carry font-lock face properties.
Each span's resolved foreground (falling back to the `default'
face's foreground) is blended toward BG by RATIO via
`eca-completion--blend-color', and the result is layered on the
span as a higher-priority anonymous face so the original
font-lock face still contributes its non-color attributes.
Spans whose colors cannot be resolved are left untouched."
(let* ((result (copy-sequence text))
(len (length result))
(default-fg (face-foreground 'default))
(pos 0))
(while (< pos len)
(let* ((next (or (next-single-property-change pos 'face result)
len))
(face-prop (get-text-property pos 'face result))
(fg (or (eca-completion--resolve-foreground face-prop)
default-fg))
(blended (and fg bg
(eca-completion--blend-color fg bg ratio))))
(when blended
(add-face-text-property pos next
(list :foreground blended)
nil result))
(setq pos next)))
result))