On Wed, Apr 16, 2008 at 12:40 PM, Aniello Del Sorbo &lt;<a href="mailto:anidel@gmail.com">anidel@gmail.com</a>&gt; wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Anyway.. the first issue below happened because I was running Xournal from root in an SSH remote shell.<br>
Thus, probably, colormaps&nbsp; were wrong.<br>Running it the usual way (from the Menu) fixed a bit things.<br>The GdkColor returned by the hildon color chooser was, when drawn on the canvas, slightly different from the one showed in the button itself.<br>

I think it looked darker.<br><br>After digging a bit I figured out that the GdkColor RGB values where RGB16 (guint16) while I needed the RGB8 format (for the &quot;fill-color-rgba&quot; property).<br>Thus, I had to first divide red, green and blue by 255 before putting them into a single guint value (RGBA) in the form of 0xRRGGBBAA.<br>

<br>guint rgba = GNOME_CANVAS_COLOR_A&nbsp; (color-&gt;red / 255.0, color-&gt;green / 255.0, color-&gt;blue / 255.0, alpha)<br></blockquote><div><br>Further corrected, the divisor should not be 255 but 257 (0x101) instead.<br>
Otherwise the reduction from RGB16 to RGB8 does not work.<br>RGB16 is in the form: 0xRRRRGGGGBBBB i.e. values range from 0 to 65535<br>RGB8 is in the form 0xRRGGBB i.e. values range from 0 to 255.<br><br></div></div>Sorry if this is stuff people already know, but I am new to it and couldn&#39;t find much about it.<br clear="all">
<br>-- <br>anidel