As shown in this table, the decimal system (which uses base 10), uses digits that go from zero to nine, then repeats by prepending a 1 to the number (resulting in 10, 11, 12, etc), then when it repeats again, it prepends a 2 (resulting in 20, 21, 23, etc), and then a 3, etc. Most people in the modern world are used to the decimal system. So it can be any of the values in the "Hex." column of the following table. Possible ValuesĮach character can be a hexadecimal value from 0 to F. You can also use the rgba() function to provide the decimal equivalent of a transparent color using the RGBA values.įor example, #FFA500CC (slightly transparent orange) could be written as rgba(255,165,0,0.8). See 4-Digit Hex Colors for more information. To convert an eight-digit code to four digits, simply dedupe the duplicate values from each color component (including the alpha channel). Just as the six-digit hex notation allows for a three-digit shorthand notation, the eight-digit notation allows for a four-digit shorthand notation. If the examples on this page display no color, it's likely your browser doesn't support this method of specifying colors. The first six characters represent the RGB (red, green, blue) value of the color, the last two represent the alpha chanel of the color.Īt the time of writing, eight-digit hex notation is merely a proposal of the latest CSS spec (CSS Color Module Level 4).īrowser support for 8 digit hex values is limited at the time of writing. SyntaxĮight-digit hex notation consists of a hash symbol ( #), followed by eight characters. A value of 00 represents a fully transparent color, and a value of FF represents a fully opaque color. ![]() This last pair of digits are interpreted as a hexadecimal number (just like the other digits). The alpha channel is represented by the last two digits. These two digits represent the alpha channel of the color. The difference is, eight-digit notation, as the name suggests, adds two more digits. How it WorksĮight-digit hex notation works the same as the six-digit notation, in that you provide a six-digit hexadecimal value, prefixed with a hash ( #) symbol. ![]() Just as the rgba(), hsla(), and hwb() functions allow us to specify an alpha channel, so too, does the eight-digit hexadecimal color notation. ![]() The purpose of an eight-digit hex code is to allow us to add transparency to the color. Hexadecimal notation (or simply, "hex notation") consists of 6 hexadecimal digits that represent the red, green, and blue components of a color.ĬSS Color Module Level 4 introduced an eight-digit hex notation. The CSS 8-digit hex color notation allows you to specify RGB colors using hexadecimal values, while at the same time, specifying its transparency.ĬSS has always allowed us to apply color to a web page using hexadecimal notation.
0 Comments
Leave a Reply. |