Follow me on Twitter!
Product Spotlight
(0 votes)

Tip: How to define a hexidecimal color and set transparency to it

0 comments   /   posted by Martin Mihaylov on Sep 08, 2008

A definition of a color in hexidecimal format looks like this: #000000 for black and #ffffff for white. The first two symbols represent the value for red, the second two - for green and the last two - for blue. (If you're not familiar with the Hexidecimal numeral system take a look at this.) Changing these values we can get every color we like. But as you probably know the colors in Silverlight have not only Red, Green and Blue attributes but also an Alpha attribute which determines the transparency of the color.In order to use the Alpha attribute of the color we add two more digits at the start - #00000000 for black with 0% opacity (full transparency) and #ff000000 for black with 100% opacity (no transparency). Changing this value also changes the transparency.

That's it!

Filed under: General


Comments

Comments RSS RSS
No comments

Add Comment