| 5820 | | (defun ps-rgb-color (color default) |
|---|
| 5821 | | (cond ((and color (listp color) (= (length color) 3) |
|---|
| 5822 | | (let ((cl color) |
|---|
| 5823 | | (ok t) e) |
|---|
| 5824 | | (while (and ok cl) |
|---|
| 5825 | | (setq e (car cl) |
|---|
| 5826 | | cl (cdr cl) |
|---|
| 5827 | | ok (and (floatp e) (<= 0.0 e) (<= e 1.0)))) |
|---|
| 5828 | | ok)) |
|---|
| 5829 | | color) |
|---|
| 5830 | | ((and (floatp color) (<= 0.0 color) (<= color 1.0)) |
|---|
| 5831 | | (list color color color)) |
|---|
| 5832 | | ((stringp color) (ps-color-scale color)) |
|---|
| 5833 | | (t (list default default default)) |
|---|
| 5834 | | )) |
|---|
| | 5820 | (defun ps-rgb-color (color unspecified default) |
|---|
| | 5821 | (cond |
|---|
| | 5822 | ;; (float float float) ==> (R G B) |
|---|
| | 5823 | ((and color (listp color) (= (length color) 3) |
|---|
| | 5824 | (let ((cl color) |
|---|
| | 5825 | (ok t) e) |
|---|
| | 5826 | (while (and ok cl) |
|---|
| | 5827 | (setq e (car cl) |
|---|
| | 5828 | cl (cdr cl) |
|---|
| | 5829 | ok (and (floatp e) (<= 0.0 e) (<= e 1.0)))) |
|---|
| | 5830 | ok)) |
|---|
| | 5831 | color) |
|---|
| | 5832 | ;; float ==> 0.0 = black .. 1.0 = white |
|---|
| | 5833 | ((and (floatp color) (<= 0.0 color) (<= color 1.0)) |
|---|
| | 5834 | (list color color color)) |
|---|
| | 5835 | ;; "colorName" but different from "unspecified-[bf]g" |
|---|
| | 5836 | ((and (stringp color) (not (string= color unspecified))) |
|---|
| | 5837 | (ps-color-scale color)) |
|---|
| | 5838 | ;; ok, use the default |
|---|
| | 5839 | (t |
|---|
| | 5840 | (list default default default)))) |
|---|