Function: tty-color-define

tty-color-define is a byte-compiled function defined in tty-colors.el.gz.

Signature

(tty-color-define NAME INDEX &optional RGB FRAME)

Documentation

Specify a tty color by its NAME, terminal INDEX and RGB values.

NAME is a string, INDEX is typically a small integer used to send to the terminal driver a command to switch this color on, and RGB is a list of 3 numbers that specify the intensity of red, green, and blue components of the color. If specified, each one of the RGB components must be a number between
0 and 65535. If RGB is omitted, the specified color will never be used
by tty-color-translate as an approximation to another color. FRAME is the frame where the defined color should be used. If FRAME is not specified or is nil, it defaults to the selected frame.

Probably introduced at or before Emacs version 21.1.

Source Code

;; Defined in /usr/src/emacs/lisp/term/tty-colors.el.gz
(defun tty-color-define (name index &optional rgb frame)
  "Specify a tty color by its NAME, terminal INDEX and RGB values.
NAME is a string, INDEX is typically a small integer used to send to
the terminal driver a command to switch this color on, and RGB is a
list of 3 numbers that specify the intensity of red, green, and blue
components of the color.
If specified, each one of the RGB components must be a number between
0 and 65535.  If RGB is omitted, the specified color will never be used
by `tty-color-translate' as an approximation to another color.
FRAME is the frame where the defined color should be used.
If FRAME is not specified or is nil, it defaults to the selected frame."
  (if (or (not (stringp name))
	  (not (integerp index))
	  (and rgb (or (not (listp rgb)) (/= (length rgb) 3))))
      (error "Invalid specification for tty color \"%s\"" name))
  (tty-modify-color-alist
   (append (list (tty-color-canonicalize name)
		 (or (tty-color-24bit rgb frame) index))
	   rgb)
   frame))