1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>XmHTML Programmers Manual: XmHTMLAllocColor</TITLE>
<META HTTP-EQUIV="Keywords" CONTENT="XmHTML, HTML, Motif, Widget, eXode, XntHelp, Linux">
<META HTTP-EQUIV="Reply-to" CONTENT="ripley@xs4all.nl">
<META HTTP-EQUIV="Description" CONTENT="XmHTMLAllocColor - a convenience function for allocating a color">
<META NAME="Author" CONTENT="Koen D'Hondt">
<META NAME="Copyright" content="1995-1997 by Ripley Software Development">
<META NAME="Source" content="$Source$">
<META NAME="Revision" content="$Revision$">
<META NAME="Font" content="helvetica">
<link rev="made" href="mailto:ripley@xs4all.nl">
<link rel="home" href="index.html">
<link rel="next" href="AncGetId.html">
<link rel="up" href="../man.html">
<link rel="copyright" href="copyrights.html">
</HEAD>
<BODY BGCOLOR="#FFFFFF" text="#000000">
<h3><font face="helvetica,arial">Name</font></h3>
<blockquote>
XmHTMLAllocColor - a convenience function for allocating a color
</blockquote>
<h3><font face="helvetica,arial">Synopsis</font></h3>
<blockquote>
Pixel XmHTMLAllocColor(Widget w, String color, Pixel def_pixel)
</blockquote>
<h3><font face="helvetica,arial">Description</font></h3>
<blockquote>
XmHTMLAllocColor allocates the requested color using the colormap of
the given widget. When the color can not be matched exactly, a least
squares algorithm is used to search for the closest color in the
colormap.
<p>
<dl>
<dt>w
<dd>Specifies the parent Widget ID. Colors are allocated using the
colormap of this widget, which does not have to be a XmHTML widget;
<dt>color
<dd>Specifies the color to be allocated. This can be either a symbolic
name (e.i., <tt>SlateBlue</tt>) or an RGB triplet of the form #RRGGBB.
Case is ignored;
<dt>def_pixel
<dd>the pixel to be returned if the requested color could not be
allocated;
</dl>
</blockquote>
<h3><font face="helvetica,arial">Return Value</font></h3>
<blockquote>
A pixel value representing the allocated color.
</blockquote>
<h3><font face="helvetica,arial">Examples</font></h3>
<blockquote>
Allocate the (symbolic) color red and return the default black pixel if
allocation fails.
</blockquote>
<pre>
Pixel pix;
Widget w;
pix = XmHTMLAllocColor(w, "Red", BlackPixelOfScreen(XtScreen(w)));
</pre>
<blockquote>
Allocate a RGB color and return the default white pixel if allocation
fails.
</blockquote>
<pre>
Pixel pix;
Widget w;
pix = XmHTMLAllocColor(w, "#3e0fc1", WhitePixelOfScreen(XtScreen(w)));
</pre>
<h3><font face="helvetica,arial">See Also</font></h3>
<blockquote>
XmHTMLFreeColor(3X), XParseColor(3X), XAllocColor(3X)
</blockquote>
<hr noshade size="2" width="25%">
<i><font size="-1">
XmHTML, October 7, 1997
</font></i>
</body>
</html>
|