Closed Fuco1 closed 5 months ago
This is a working version
(defun rainbow-colorize-match (color &optional match)
"Return a matched string propertized with a face whose
background is COLOR. The foreground is computed using
`rainbow-color-luminance', and is either white or black."
`((:foreground ,(if (> 0.5 (rainbow-x-color-luminance color))
"white" "black"))
(:background ,color))
;; (let ((match (or match 0)))
;; (put-text-property
;; (match-beginning match) (match-end match)
;; 'face `((:foreground ,(if (> 0.5 (rainbow-x-color-luminance color))
;; "white" "black"))
;; (:background ,color))))
)
The patched code is already upstream
rainbow-colorize-match
should not put the properties itself, rather it should only return the list and let font-lock do it.Contact https://julien.danjou.info/about/ about a patch because there is no github repo where we could submit a patch and fuck emacs devel ML.