summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2020-06-10 19:18:58 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2020-06-10 20:11:13 +0200
commit68ae6faa7f1b4c348740667f98fbf1d1ce5a7979 (patch)
tree2a1e1c310ad97110a9f691d29b5e51505fa7418b /lisp/emacs-lisp
parentb19259c8412ee2e715c4bd145711e23729411fd0 (diff)
downloademacs-68ae6faa7f1b4c348740667f98fbf1d1ce5a7979.tar.gz
emacs-68ae6faa7f1b4c348740667f98fbf1d1ce5a7979.tar.bz2
emacs-68ae6faa7f1b4c348740667f98fbf1d1ce5a7979.zip
Improved light/dark colour predicate (bug#41544)
Add a predicate, color-dark-p, for deciding whether a colour is more readable with black or white as contrast. It has experimentally been shown to be more accurate and robust than the various methods currently employed. The new predicate compares the relative luminance of the colour to an empirically determined cut-off value, and it seems to get it right in almost all cases, with no value leading to outright bad results. * lisp/faces.el (readable-foreground-color): Use color-dark-p. (color-dark-p): New function. * lisp/facemenu.el (list-colors-print): Use readable-foreground-color, improving readability of list-colors-display. * lisp/textmodes/css-mode.el (css--contrasty-color): Remove. (css--fontify-region): Use readable-foreground-color.
Diffstat (limited to 'lisp/emacs-lisp')
0 files changed, 0 insertions, 0 deletions