Date: Fri, 09 Sep 2005 08:36:01 +0900 (JST) Message-Id: <20050909.083601.03366715.garrigue at math.nagoya-u.ac.jp> To: romildo at uber.com.br Cc: lablgtk at math.nagoya-u.ac.jp Subject: Re: Constructing a value of type Gdk.color From: Jacques Garrigue In-Reply-To: <20050908171000.GA17806 at malaquias> References: <20050908171000.GA17806 at malaquias> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: romildo at uber.com.br > I am looking for an easy way of constructing > a value of type Gdk.color, given its red, green > and blue components. > > Looking in module interface gdk.mli, I see > only one function that returns a Gdk.color: > > val Gdk.Color.alloc colormap:Gdk.colormap -> Gdk.Color.spec -> color > > I do not need to alloc the color in a colormap. The function exists, but is not exported. You can import it in your own module by declaring external color_create : red:int -> green:int -> blue:int -> color = "ml_GdkColor" LablGTK tries to not use that intermediate level: all unallocated colors can be expressed with Gdk.Color.spec for more generality. Jacques