Function: ps-rgb-color

ps-rgb-color is a byte-compiled function defined in ps-print.el.gz.

Signature

(ps-rgb-color COLOR UNSPECIFIED DEFAULT)

Source Code

;; Defined in /usr/src/emacs/lisp/ps-print.el.gz
(defun ps-rgb-color (color unspecified default)
  (cond
   ;; (float float float) ==> (R G B)
   ((and color (listp color) (= (length color) 3)
	 (let ((cl color)
	       (ok t) e)
	   (while (and ok cl)
	     (setq e  (car cl)
		   cl (cdr cl)
		   ok (and (floatp e) (<= 0.0 e) (<= e 1.0))))
	   ok))
    color)
   ;; float ==> 0.0 = black .. 1.0 = white
   ((and (floatp color) (<= 0.0 color) (<= color 1.0))
    (list color color color))
   ;; "colorName" but different from "unspecified-[bf]g"
   ((and (stringp color) (not (string= color unspecified)))
    (ps-color-scale color))
   ;; ok, use the default
   (t
    (list default default default))))