Hex representation of a color with alpha channel? | rgba to hex alpha
InCSS3,toquotefromthespec,"thereisnohexadecimalnotationforanRGBAvalue"(seeCSSLevel3spec[1]).Insteadyoucantheusergba()functionalnotationwithdecimalsorpercentages,e.g.rgba(255,0,0,0.5)wouldbe50%transparentred.RGBchannelsare0-255or0%-100%,alphais0-1.InCSS4*,youcanspecifythealphachannelusingthe7thand8thcharactersofan8digithexcolour,or4thcharacterofa4digithexcolour(seeCSSLevel4spec[2]*)AsofMay2019,>80%ofuserscanbeexpectedtounderstandthe#RGBAformatFirefoxhassupportedthissyntaxsinceFirefox49(Moz...
In CSS 3, to quote from the spec, "there is no hexadecimal notation for an RGBA value" (see CSS Level 3 spec[1]). Instead you can the use rgba() functional notation with decimals or percentages, e.g. rgba(255, 0, 0, 0.5) would be 50% transparent red. RGB channels are 0-255 or 0%-100%, alpha is 0-1.
In CSS 4*, you can specify the alpha channel using the 7th and 8th characters of an 8 digit hex colour, or 4th character of a 4 digit hex colour (see CSS Level 4 spec[2]*)
As of May 2019, >80% of users can be expected to understand the #RGBA format
Firefox has supported this syntax since Firefox 49 (Mozilla bug 567283[3]). Safari has supported this syntax since Safari 10. Chrome has supported this syntax since Chrome 62. For earlier versions you could enable experimental web features to use this syntax. See Chromium Issue 618472[4] and Webkit bug 150853[5]. Android Apps that target Android P or newer can use this syntax Opera supports this syntax in Opera 52 (or O...