Arrays in properties.xml?

I've searched everywhere and must have missed how to do this (I'm sure it must be simple). I'd like to store an array of colour values in properties.xml then read it for the watchface. How to do that?

This does not build:

<property id="colours" type="array">[0x000000, 0xFFFFFF, 0x00FF00, 0xFFAA00]</property>

The followup question would be how to read in the array? I generally use

App.Properties.getValue("colours").toNumber();

for reading in single numbers, but not sure if that works with an array. Thanks!

  • What do you get if you just leave off the toNumber()?

    I'm not sure how a user would enter this for a setting, and if it's not entered by a user, why not just hard code it in your app?

    Actually, an array isn't valid for a property, so you can't do what you planned.. (per the programmer's guide)

    Only string, number, float and boolean

  • I see. I checked the programmer's guide, I thought arrays were valid for property... Must have misread. I'll workaround with a series of single numbers instead. I'd like to use the properties to be able to allow (in future) the user to choose different colours via the settings. Thanks for your help.