Global variable error with dynamic color in drawablelist

Former Member
Former Member
I'm getting an error when trying to use a global variable for the color attribute of a drawable. It worked in previous SDK versions (<2.x) without the bling but it isn't compiling anymore in version 2.1.5 (with or without $. Is there a way to do this:

using Toybox.Graphics as Gfx;
using Toybox.Application as App;

//Global variables
var numColor = Gfx.COLOR_RED;

class <appname> extends App.AppBase



in drawable xml:

<shape type="rectangle" x="0" y="0" width="100" height="61" color="$.numColor" />

Here is the error:
BUILD: ERROR: Rez:56: mismatched input 'x' expecting {<list of all operators>}
BUILD: WARNING: Attribute 'color' in ID '' has an invalid value '$.numColor'

The goal is to have a dynamic color and when the View.onUpdate() is called, it changes. would it be better to use x.setColor() ?