This abstraction creates a regular Pd graphical array, where color and line width can be set.
Screenshot from 2017-12-25 06:28:30.png

Download: colarray.zip

The attributes of the array can be dynamically set by messages. As it is a regular array, it can be accessed by the usual array functions like [array get], [array set] etc. Save contents is the only feature [colarray] doesn't support, as the array is within the abstraction.

[colarray] makes use of the undocumented (?) fields for color and line width, that are hidden in the Pd source code. The regular graphical array is made from a data structure template, that is defined in a hidden patch, which is opened in the background on startup. [colarray] adds a send object to that patch to get messages from the [struct] object there. After creating the array, a mouse message to that array triggers a click message from the [struct] with the pointer to the array. This pointer is used to set color and line width.

To see the hidden patch that holds the template, you can use this patch: show-hidden-template.pd