diff --git a/scheme/xlib/color-type.scm b/scheme/xlib/color-type.scm index 7a34559..f900f6a 100644 --- a/scheme/xlib/color-type.scm +++ b/scheme/xlib/color-type.scm @@ -6,6 +6,12 @@ (tag color-tag color-set-tag!) (Xcolor color-Xcolor color-set-Xcolor!)) +(define-record-discloser :color + (lambda (c) + (let ((rgb (extract-rgb-values c))) + `(Color ,(/ (car rgb) 65535) ,(/ (cadr rgb) 65535) + ,(/ (caddr rgb) 65535))))) + (define (internal-make-color Xcolor) (let ((maybe-color (color-list-find Xcolor))) (if maybe-color @@ -25,7 +31,7 @@ (import-lambda-definition %create-color (r g b) "scx_Create_Color") -;; returns a list of r,g,b as integers +;; returns a list of r,g,b as integers from 0 - 2^16 (define (extract-rgb-values color) (%extract-rgb-values (color-Xcolor color)))