=== modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2011-01-31 23:54:50 +0000 +++ doc/lispref/display.texi 2011-03-10 19:03:48 +0000 @@ -2057,6 +2057,21 @@ black-and-white displays, certain shades of gray are implemented by stipple patterns. +You may want to set the foreground automatically in some cases using +the @code{color-complement} and @code{color-rgb-to-hex} functions from +the @code{color.el} library. Here's an example: + +@example +(defface myface + (let ((color "red")) + `((((class color) (background light)) + (:foreground ,color)) + (((class color) (background dark)) + (:foreground ,(apply 'color-rgb-to-hex (color-complement color)))) + (t nil))) + "My face.") +@end example + @item :background Background color, a string. The value can be a system-defined color name, or a hexadecimal color specification. @xref{Color Names}.