开发者

Color structure and html

开发者_开发技巧

In Html we specify color as amount of red, green and blue. But in net we specify color as an amount alpha, red, green and blue.

a) What does alpha value represent? b) Since the purpose of Color structure is to specify a html supported color ( RGB value ), I don’t see a point in Color structure also including alpha value, since html/CSS doesn’t support it?!

thanx


The Color Structure is actually part of the System.Drawing namespace in the framework. It is used for things other than merely HTML color, including graphics and imagery, where an alpha channel makes sense.

When you're dealing with HTML color, you can just use the FromArgb overload that only specifies red, green, and blue (and alpha to fully opaque).

I think your confusion lies here:

"Since the purpose of Color structure is to specify a html supported color"

That is not the purpose of the Color structure, but rather one specific use of the Color structure. This structure has many other, very valid uses, where having an Alpha channel makes sense. Instead of requiring people to work with multiple Color structures, the framework uses a single, general purpose structure. I believe this was a good choice, since it simplifies the number of types, and keeps the "color" interoperable with other code using Color types.


a) The alpha channel is the transparency channel. b) supply it with the appropriate value for not transparent and don't expose it in your own functions.


The Alpha value indicates transparency.

.NET is used for more than just ASP.NET.


Alpha refers to transparency/opacity level. wikipedia on alpha

CSS does use opacity in some ways.


Alpha is the ratio in which the pixel should be blended with the background pixel below it. I didnt know html didnt support transparency. I always thought browsers would support transparency.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜