Thanks, Claude. I was really wondering if this was something that I am doing wrong. Is this documented somewhere? If not, it should be. But then again, the internals of the file format are not documented as they should be. One of the things that I found in the Help file (no mention made of the differences between the file format and the message format), was that it was not clear to the person writing the help file as to what the last number does.<br>
<br>Guess I have something to document with my project. (Anyone up for some Sudoku in Pd?)<br><br>Mike<br><br><br><div class="gmail_quote">On Mon, Jul 7, 2008 at 1:06 PM, Claude Heiland-Allen &lt;<a href="mailto:claudiusmaximus@goto10.org">claudiusmaximus@goto10.org</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">Mike McGonagle wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello all,<br>
<br>
I have a program that I have written that creates lots of small &#39;cnv&#39;<br>
objects, where I am changing the colors of the backgrounds and the text in<br>
the object. I was noticing that when I create these cnv objects, I have to<br>
use a different &#39;color number&#39; to get the same color when I change it with<br>
the cnv &#39;color&#39; message (which changes both the background and text colors<br>
in the same message).<br>
<br>
Is this documented anywhere as to the relation between these two different<br>
color definitions?<br>
</blockquote>
<br></div>
Not as far as I&#39;m aware, but here&#39;s my implementations that work for me:<br>
<br>
/* colour */<br>
float r, g, b; /* 0&lt;={r,g,b}&lt;=1 */<br>
<br>
/* RGB -&gt; Pd file */<br>
int c = ((((int) (r * 63.0)) &lt;&lt; 12)<br>
 &nbsp; &nbsp; &nbsp;| (((int) (g * 63.0)) &lt;&lt; 6)<br>
 &nbsp; &nbsp; &nbsp;| ((int) (b * 63.0))) ^ (-1);<br>
<br>
/* RGB -&gt; Pd message */<br>
int c = ((((int) (r * 255.0)) &lt;&lt; 16)<br>
 &nbsp; &nbsp; &nbsp;| (((int) (g * 255.0)) &lt;&lt; 8)<br>
 &nbsp; &nbsp; &nbsp;| ((int) (b * 255.0))) ^ (-1);<br>
<br>
<br>
Claude<br><font color="#888888">
-- <br>
<a href="http://claudiusmaximus.goto10.org" target="_blank">http://claudiusmaximus.goto10.org</a><br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Peace may sound simple—one beautiful word— but it requires everything we have, every quality, every strength, every dream, every high ideal.<br>—Yehudi Menuhin (1916–1999), musician