[PD-dev] [pure-data:patches] #569 load/save iemgui colors as symbols rather than numbers

IOhannes m zmölnig zmoelnig at users.sf.net
Mon Jan 11 22:44:17 CET 2016


** [patches:#569] load/save iemgui colors as symbols rather than numbers**

**Status:** open
**Group:** bugfix
**Labels:** puredata pd-gui 
**Created:** Mon Jan 11, 2016 09:44 PM UTC by IOhannes m zmölnig
**Last Updated:** Mon Jan 11, 2016 09:44 PM UTC
**Owner:** Miller Puckette

- [0001-updated-iemgui-s-color-functions-for-loading-saving.patch](https://sourceforge.net/p/pure-data/patches/569/attachment/0001-updated-iemgui-s-color-functions-for-loading-saving.patch) (88.8 kB; text/x-diff)

currently all iemgui-objects store the colors in some weirdo format, that tries to crunch 24bit unsigned numbers (RGB) into a float.
this format has a number of shortcomings:
- it cannot accurately represent all colors of the 24bit range
- nobody understands it

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. `#FF0000` represents pure red
(opposed to the currently used `-258049` which is the best approximation of red one can store...although it really is `#fc0000`).

### implementation details
the old numeric format is still understood.

the patch implements:
- setting the color via color-message, e.g. `[color #ff0000 #ff00ff #ffffff(`
- loading "symbolic colors" in a patch
- saving "symbolic colors" to the patch (optional)

however, *saving* 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).
the idea is to disable the compat-mode (by setting the default compatibility value to `0` in `g_all_guis.c:269` in the next release save one).
setting a "pd_compatibility" to <48 will always save in the legacy format.

### english color names
tcl/tk can understand a few english color names (such as `red`).
the current implementation does **not** support this, as the colors are still handled as integers internally (to ease the implementation of the backwards compat mode)


Sent from sourceforge.net because pd-dev at lists.iem.at is subscribed to https://sourceforge.net/p/pure-data/patches/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/pure-data/admin/patches/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20160111/a95057a0/attachment.html>

More information about the Pd-dev mailing list