<div class="markdown_content"><hr/>
<p><strong> <a class="alink" href="http://sourceforge.net/p/pure-data/patches/569/">[patches:#569]</a> load/save iemgui colors as symbols rather than numbers</strong></p>
<p><strong>Status:</strong> open<br/>
<strong>Group:</strong> bugfix<br/>
<strong>Labels:</strong> puredata pd-gui <br/>
<strong>Created:</strong> Mon Jan 11, 2016 09:44 PM UTC by IOhannes m zmölnig<br/>
<strong>Last Updated:</strong> Mon Jan 11, 2016 09:44 PM UTC<br/>
<strong>Owner:</strong> Miller Puckette<br/>
<strong>Attachments:</strong></p>
<ul>
<li><a class="" href="https://sourceforge.net/p/pure-data/patches/569/attachment/0001-updated-iemgui-s-color-functions-for-loading-saving.patch">0001-updated-iemgui-s-color-functions-for-loading-saving.patch</a> (88.8 kB; text/x-diff)</li>
</ul>
<p>currently all iemgui-objects store the colors in some weirdo format, that tries to crunch 24bit unsigned numbers (RGB) into a float.<br/>
this format has a number of shortcomings:<br/>
- it cannot accurately represent all colors of the 24bit range<br/>
- nobody understands it</p>
<p>the proposed patch changes this so that colors can now be given as symbols in a format that is directly understood by tcl/tk: e.g. <code>#FF0000</code> represents pure red<br/>
(opposed to the currently used <code>-258049</code> which is the best approximation of red one can store...although it really is <code>#fc0000</code>).</p>
<h3 id="implementation-details">implementation details</h3>
<p>the old numeric format is still understood.</p>
<p>the patch implements:<br/>
- setting the color via color-message, e.g. <code>[color #ff0000 #ff00ff #ffffff(</code><br/>
- loading "symbolic colors" in a patch<br/>
- saving "symbolic colors" to the patch (optional)</p>
<p>however, <em>saving</em> symbolic colors is currently disabled, to allow for a migration away from the current scheme (that is: a Pd-patch saved will still be fully functional in older Pd-versions).<br/>
the idea is to disable the compat-mode (by setting the default compatibility value to <code>0</code> in <code>g_all_guis.c:269</code> in the next release save one).<br/>
setting a "pd_compatibility" to <48 will always save in the legacy format.</p>
<h3 id="english-color-names">english color names</h3>
<p>tcl/tk can understand a few english color names (such as <code>red</code>).<br/>
the current implementation does <strong>not</strong> support this, as the colors are still handled as integers internally (to ease the implementation of the backwards compat mode)</p>
<hr/>
<p>Sent from sourceforge.net because pd-dev@lists.iem.at is subscribed to <a href="https://sourceforge.net/p/pure-data/patches/">https://sourceforge.net/p/pure-data/patches/</a></p>
<p>To unsubscribe from further messages, a project admin can change settings at <a href="https://sourceforge.net/p/pure-data/admin/patches/options.">https://sourceforge.net/p/pure-data/admin/patches/options.</a>  Or, if this is a mailing list, you can unsubscribe from the mailing list.</p></div>