Firefox parsing 4 digit hex color values as rgba

前端 未结 2 427
孤独总比滥情好
孤独总比滥情好 2021-01-28 03:41

Recently observed (by accident) that Firefox (I\'m using v49) is parsing 4 digit hex colors as rgba. Reading up on the CSS spec, I don\'t see any mention of support for this an

2条回答
  •  悲哀的现实
    2021-01-28 04:05

    It's legit:

    Colors can be defined in the Red-green-blue-alpha model (RGBa) in two ways:

    Hexadecimal notation #RRGGBBAA and #RGBA

    • "#", followed by eight hexadecimal characters (0-9, A-F), where the first two digits represent the red part, the second two the green part, the third two the blue part and the last two the transparency.
    • "#", followed by four hexadecimal characters (0-9, A-F), where the first digit represents the red part, the second the green part, the third one the blue part and the last one the transparency. The four-digit RGB notation (#RGBA) and the eight-digit form (#RRGGBBAA) are equal, for example, #f038 and #ff003388 represent the same color.

    It's supported by Chrome 52, Firefox 49, Opera 39, and Safari 9.1

提交回复
热议问题