<div dir="ltr"><div>Yeah, one year of retention in the inbox, see how we are cautious with first timers ;)<br></div>Anyway congratulations<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014/1/10 Jeff Gonis <span dir="ltr">&lt;<a href="mailto:jeff.gonis@gmail.com" target="_blank">jeff.gonis@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Holy smokes!  This was my first ever open source contribution I think, or at least very near to my first.  A blast from the past! Thanks for integrating it Nicolas.<br>
</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Thu, Jan 9, 2014 at 5:57 PM,  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Nicolas Cellier uploaded a new version of Graphics to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Graphics-jmg.191.mcz" target="_blank">http://source.squeak.org/trunk/Graphics-jmg.191.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Graphics-jmg.191<br>
Author: jmg<br>
Time: 6 January 2012, 2:37:58.42 pm<br>
UUID: 64aae19a-1a36-a346-ae1c-48f25bf77127<br>
Ancestors: Graphics-bf.190<br>
<br>
asColorref was using the color&#39;s green element twice, instead of red, green, and blue. Also, Color did not have a symmetrical constructor to create a Color from a colorref. Finally, converting from a float to an integer by using asInteger, rather than round seemed like the wrong thing to do.<br>


<br>
I tested this by iterating through Color class&gt;&gt;indexedColors, and converting them to colorrefs, then creating a Color from the colorref, and comparing the original with the new color.  Without rounding I received ~239 failures and with rounding I received ~21 (still to be expected as we are converting a float in the range 0.0 - 1.0 to an integer in the range 0 - 255, so there will still be some error).<br>


<br>
=============== Diff against Graphics-bf.190 ===============<br>
<br>
Item was added:<br>
+ ----- Method: Color class&gt;&gt;fromColorref: (in category &#39;instance creation&#39;) -----<br>
+ fromColorref: aColorref<br>
+       | red green blue |<br>
+       red := aColorref bitAnd: 255.<br>
+       green := (aColorref bitAnd: 65280)<br>
+                               &gt;&gt; 8.<br>
+       blue := (aColorref bitAnd: 16711680)<br>
+                               &gt;&gt; 16.<br>
+       ^ self r: red g: green b: blue range: 255.!<br>
<br>
Item was changed:<br>
  ----- Method: Color&gt;&gt;asColorref (in category &#39;conversions&#39;) -----<br>
  asColorref<br>
        &quot;Convert the receiver into a colorref&quot;<br>
+       ^ (self red * 255) rounded + ((self green * 255) rounded &lt;&lt; 8) + ((self blue * 255) rounded &lt;&lt; 16)!<br>
-       ^(self red * 255) asInteger + ((self green * 255) asInteger &lt;&lt; 8) + ((self green * 255) asInteger &lt;&lt; 16)!<br>
<br>
<br>
</blockquote></div><br></div>
</div></div><br><br>
<br></blockquote></div><br></div>