05-13-2020 15:33
05-13-2020 15:33
Hi, sorry if this has been previously answered but I'm struggling to figure it out. I have a button like this:
<use id="b1" class="button" href="#push-button" y='40' height="65"
fill="fb-black" font-family="System-Regular" font-size="20">
<set href="#text" attributeName="fill" to="fb-peach" />
<set href="#text" attributeName="y" to="12" />
<set href="#text" attributeName="text-length" to="20" />
</use>
How do I go about changing the colour of the text inside the button programmatically? I don't understand how to access the attributes that are inside the set tags. Sorry if this is a stupid question or something that I don't understand about how this works, but I would appreciate an answer. Thank you!
05-14-2020 13:04 - edited 05-14-2020 13:08
05-14-2020 13:04 - edited 05-14-2020 13:08
I am not certain that this would work, but if you added the text to a class, then you could easily overload the color for that class. Here is an example I use for my watchface.
<text id ="monthLabel"class="face"></text>
My CSS file has this in it...
.face {fill:#20e7ff }
Then, in my css, I define the style attributes for the class face. I think you can overload that too, changing it programatically in your code.
Edit: I added the CSS too just in case it helps anyone.