Karl Viiburg
Karl Viiburg

Reputation: 832

Custom hex/rgb background color in windows phone 8

I'm a newcomer to the world of Windows Phone development. I've googled and looked up the Windows Phone documentation but I still can't find what I'm looking for (or I probably missed it).

My question is how can I have a custom hex/rgb background color instead of the predefined colors the Windows Phone SDK gives? Is it possible?

Upvotes: 1

Views: 431

Answers (1)

Chubosaurus Software
Chubosaurus Software

Reputation: 8161

Sure it can, otherwise everyone apps would look the same :D

using using System.Windows.Media;

Color pure_red = Color.FromArgb(0xFF, 0xFF, 0x00, 0x00);   // alpha,red,green,blue

sometimes an UI element wants a Brush instead, if that is the case then you want something like this

this.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x00, 0x00));

good luck :D

Upvotes: 1

Related Questions