Why is there a leading “#FF” in hexadecimal color values?

后端 未结 3 1467
执念已碎
执念已碎 2021-01-12 21:18

I\'m using Expression Blend 3 and am writing some of the XAML by hand, specifically the color values of controls.

I have a list of RGB colors already converted to hex

相关标签:
3条回答
  • 2021-01-12 21:43

    That may be the alpha component of the color, which represents the opacity (00 -> transparent, FF -> opaque).

    MSDN seems to agree with this: Color

    16-bit hexadecimal, alpha -- #AARRGGBB

    0 讨论(0)
  • 2021-01-12 21:45

    The 'extra' FF is an alpha value (degree of transparency). If you only have three hexadecimal pairs, the alpha value is assumed to be ff (no transparency). However, if you compare #335A7F39 and #FF5A7F39, you should see a difference.

    0 讨论(0)
  • 2021-01-12 21:55

    I believe the leading FF is the alpha. 255 (or FF) being 100% opaque, and 00 would be transparent.

    0 讨论(0)
提交回复
热议问题