emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 f4ee696b887: Improve documentation of color-related functions


From: Eli Zaretskii
Subject: emacs-29 f4ee696b887: Improve documentation of color-related functions
Date: Fri, 9 Jun 2023 03:29:19 -0400 (EDT)

branch: emacs-29
commit f4ee696b887ca9f0ebf3685817f9b9cfbfc49b99
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Improve documentation of color-related functions
    
    * doc/lispref/frames.texi (Color Names): Document
    'color-name-to-rgb' and 'color-dark-p'.
---
 doc/lispref/frames.texi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index c78ab1c34ba..a8ac9a214f6 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -4518,6 +4518,20 @@ This function used to be called @code{x-color-values},
 and that name is still supported as an alias.
 @end defun
 
+@defun color-name-to-rgb color &optional frame
+This function does the same as @code{color-values}, but it returns
+color values as floating-point numbers between 0.0 and 1.0 inclusive.
+@end defun
+
+@defun color-dark-p rgb
+This function returns non-@code{nil} if the color described by its RGB
+triplet @var{rgb} is more readable against white background than
+against dark background.  The argument @var{rgb} should be a list of
+the form @w{@code{(@var{r} @var{g} @var{b})}}, with each component a
+floating-point number in the range 0.0 to 1.0 inclusive.  You can use
+@code{color-name-to-rgb} to convert a color's name to such a list.
+@end defun
+
 @node Text Terminal Colors
 @section Text Terminal Colors
 @cindex colors on text terminals



reply via email to

[Prev in Thread] Current Thread [Next in Thread]