summaryrefslogtreecommitdiff
path: root/devdocs/elisp/text-terminal-colors.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/elisp/text-terminal-colors.html')
-rw-r--r--devdocs/elisp/text-terminal-colors.html20
1 files changed, 20 insertions, 0 deletions
diff --git a/devdocs/elisp/text-terminal-colors.html b/devdocs/elisp/text-terminal-colors.html
new file mode 100644
index 00000000..6398ab79
--- /dev/null
+++ b/devdocs/elisp/text-terminal-colors.html
@@ -0,0 +1,20 @@
+ <h3 class="section">Text Terminal Colors</h3> <p>Text terminals usually support only a small number of colors, and the computer uses small integers to select colors on the terminal. This means that the computer cannot reliably tell what the selected color looks like; instead, you have to inform your application which small integers correspond to which colors. However, Emacs does know the standard set of colors and will try to use them automatically. </p> <p>The functions described in this section control how terminal colors are used by Emacs. </p> <p>Several of these functions use or return <em>rgb values</em>, described in <a href="color-names">Color Names</a>. </p> <p>These functions accept a display (either a frame or the name of a terminal) as an optional argument. We hope in the future to make Emacs support different colors on different text terminals; then this argument will specify which terminal to operate on (the default being the selected frame’s terminal; see <a href="input-focus">Input Focus</a>). At present, though, the <var>frame</var> argument has no effect. </p> <dl> <dt id="tty-color-define">Function: <strong>tty-color-define</strong> <em>name number &amp;optional rgb frame</em>
+</dt> <dd>
+<p>This function associates the color name <var>name</var> with color number <var>number</var> on the terminal. </p> <p>The optional argument <var>rgb</var>, if specified, is an rgb value, a list of three numbers that specify what the color actually looks like. If you do not specify <var>rgb</var>, then this color cannot be used by <code>tty-color-approximate</code> to approximate other colors, because Emacs will not know what it looks like. </p>
+</dd>
+</dl> <dl> <dt id="tty-color-clear">Function: <strong>tty-color-clear</strong> <em>&amp;optional frame</em>
+</dt> <dd><p>This function clears the table of defined colors for a text terminal. </p></dd>
+</dl> <dl> <dt id="tty-color-alist">Function: <strong>tty-color-alist</strong> <em>&amp;optional frame</em>
+</dt> <dd>
+<p>This function returns an alist recording the known colors supported by a text terminal. </p> <p>Each element has the form <code>(<var>name</var> <var>number</var> . <var>rgb</var>)</code> or <code>(<var>name</var> <var>number</var>)</code>. Here, <var>name</var> is the color name, <var>number</var> is the number used to specify it to the terminal. If present, <var>rgb</var> is a list of three color values (for red, green, and blue) that says what the color actually looks like. </p>
+</dd>
+</dl> <dl> <dt id="tty-color-approximate">Function: <strong>tty-color-approximate</strong> <em>rgb &amp;optional frame</em>
+</dt> <dd><p>This function finds the closest color, among the known colors supported for <var>display</var>, to that described by the rgb value <var>rgb</var> (a list of color values). The return value is an element of <code>tty-color-alist</code>. </p></dd>
+</dl> <dl> <dt id="tty-color-translate">Function: <strong>tty-color-translate</strong> <em>color &amp;optional frame</em>
+</dt> <dd><p>This function finds the closest color to <var>color</var> among the known colors supported for <var>display</var> and returns its index (an integer). If the name <var>color</var> is not defined, the value is <code>nil</code>. </p></dd>
+</dl><div class="_attribution">
+ <p class="_attribution-p">
+ Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
+ <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Terminal-Colors.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Terminal-Colors.html</a>
+ </p>
+</div>