I want to fade some elements (rectangles and ellipses) from the accent color to transparent using a LinearGradientBrush. However – the transparent color is always a color and it seems like the color “Transparent” is #00FFFFFF – that is white with 0% opacity.
I would like to fade from PhoneAccentColor to PhoneTransparentAccentColor. So if my accent color is red I would like to fade to #00FF0000 and if it is green I would like to fade to #0000FF00.
I can’t find any built in color resource for transparent accent so what are my options here? I’ve tried the options below but with no real success and I can’t find much on this topic by normal search channels so I’m not really sure what I’m missing here.
Some suggestions I came up with (however with no real success as stated earlier):
- Create a custom resource in code behind and push it into the application wide resource dictionary?
- Can I expose a property on my ViewModels with the Color and bind to it?
I can’t think of a way to specify a transparent accent color directly with xaml. I do have a couple of possible solutions.
If possible you could animate the opacity of the object rather than the color itself.
Of you could generate the color in code (probably during start up)
You could then store the color as a resource and reference it in xaml.
Hope this helps.