scx/scheme/xlib/colormap.scm

26 lines
687 B
Scheme
Raw Normal View History

2001-06-11 11:28:32 -04:00
;; Author: David Frese
(define (alloc-color colormap color)
(let ((Xpixel (%alloc-color (colormap-Xcolormap colormap)
(color-Xcolor color)
(display-Xdisplay (colormap-display colormap)))))
(if Xpixel
(make-pixel Xpixel)
Xpixel)))
(import-lambda-definiton %alloc-color (Xcolormap Xcolor Xdisplay)
"Alloc_Color")
;; ...
(define (alloc-named-color colormap color-name)
(let ((Xres (%alloc-named-color (colormap-Xcolormap colormap)
(if (symbol? color-name)
(symbol->string color-name)
color-name))))
(if Xres
(list (make-pixel (car Xres))
(apply make-color (cadr Xres))
(apply make-color (caddr Xres)))
Xres)))