HTML Hex Color Codes - GeeksforGeeks
Có thể bạn quan tâm
HEX color codes are a fundamental aspect of web design, allowing developers to specify colors in HTML and CSS with precision. These codes consist of a hash symbol (#) followed by six characters, each representing the intensity of the primary colors: red, green, and blue (RGB) in hexadecimal format.
The format for a HEX color code is #RRGGBB , where:
- The first two characters (RR) denote the intensity of the red color.
- The next two characters (GG) represent the intensity of the green color.
- The final two characters (BB) indicate the intensity of the blue color.
Each pair of characters in the HEX color code ranges from 00 to FF. A value of 00 represents the lowest intensity of the color, while FF represents the highest intensity. By combining different intensities of red, green, and blue, a wide spectrum of colors can be created. In fact, there are 16,777,216 possible color combinations with HEX codes.
What is a HEX Color Code?
A HEX color code is a hexadecimal way to represent colors in web design and other digital applications. It starts with a hash symbol (#) followed by six characters, each pair representing the intensity of red, green, and blue colors respectively. This format allows for a wide range of colors to be precisely defined and used in HTML and CSS.
The structure of a HEX color code is #RRGGBB, where:
- The first two characters (RR) indicate the intensity of the red color.
- The next two characters (GG) specify the intensity of the green color.
- The last two characters (BB) represent the intensity of the blue color.
For example:
- The color white is achieved by combining the maximum intensity of all three primary colors, resulting in the HEX code #FFFFFF.
- Conversely, the color black is achieved by combining the minimum intensity of all three primary colors, resulting in the HEX code #000000.
Note:
- The white color is a mixture of the three primary colors at full intensity representing the Hex color code #FFFFFF
- The black color is a mixture of the three primary colors at the lowest intensity representing the color code #000000
List of Common HTML Color Codes
Here is a list of some commonly used HTML Hexadecimal color codes:
COLOR NAME | COLOR | HEX COLOR CODE |
---|---|---|
SILVER | #C0C0C0 | |
GRAY | #808080 | |
MAROON | #800000 | |
OLIVE | #808000 | |
LIME | #00FF00 | |
AQUA | #00FFFF | |
TEAL | #008080 | |
NAVY | #000080 | |
FUCHSIA | #FF00FF | |
PURPLE | #800080 | |
INDIANRED | #CD5C5C | |
LIGHTCORAL | #F08080 | |
SALMON | #FA8072 | |
DARKSALMON | #E9967A | |
LIGHTSALMON | #FFA07A |
Shades of RED
COLOR NAME | COLOR | HEX COLOR CODE |
---|---|---|
lightsalmon | #FFA07A | |
salmon | #FA8072 | |
darksalmon | #E9967A | |
lightcoral | #F08080 | |
indianred | #CD5C5C | |
crimson | #DC143C | |
firebrick | #B22222 | |
red | #FF0000 | |
darkred | #8B0000 |
Shades of Orange
COLOR NAME | COLOR | HEX COLOR CODE |
---|---|---|
coral | #FF7F50 | |
tomato | #FF6347 | |
orangered | #FF4500 | |
gold | #FFD700 | |
orange | #FFA500 | |
darkorange | #FF8C00 |
Shades of Yellow
COLOR NAME | COLOR | HEX COLOR CODE |
---|---|---|
lightyellow | #FFFFE0 | |
lemonchiffon | #FFFACD | |
papayawhip | #FFEFD5 | |
moccasin | #FFE4B5 | |
peachpuff | #FFDAB9 | |
palegoldenrod | #EEE8AA | |
khaki | #F0E68C | |
darkkhaki | #BDB76B | |
yellow | #FFFF00 |
Shades of Green
COLOR NAME | COLOR | HEX COLOR CODE |
---|---|---|
lawngreen | #7CFC00 | |
limegreen | #32CD32 | |
lime | #00FF00 | |
forestgreen | #228B22 | |
darkgreen | #006400 | |
springgreen | #00FF7F | |
mediumspringgreen | #00FA9A | |
palegreen | #98FB98 | |
seagreen | #2E8B57 |
Shades of Blue
COLOR NAME | COLOR | HEX COLOR CODE |
---|---|---|
powderblue | #B0E0E6 | |
lightskyblue | #87CEFA | |
skyblue | #87CEEB | |
deepskyblue | #00BFFF | |
dodgerblue | #1E90FF | |
cornflowerblue | #6495ED | |
steelblue | #4682B4 | |
royalblue | #4169E1 | |
mediumblue | #0000CD |
Shades of White
Color Name | Color | HTML Color Code |
---|---|---|
snow | #FFFAFA | |
honeydew | #F0FFF0 | |
azure | #F0FFFF | |
ghostwhite | #F8F8FF | |
whitesmoke | #F5F5F5 | |
mintcream | #F5FFFA | |
ivory | #FFFFF0 | |
floralwhite | #FFFAF0 | |
antiquewhite | #FAEBD7 |
Shades of Brown
Color Name | Color | HTML Color Code |
---|---|---|
blanchedalmond | #FFEBCD | |
bisque | #FFE4C4 | |
wheat | #F5DEB3 | |
burlywood | #DEB887 | |
tan | #D2B48C | |
rosybrown | #BC8F8F | |
sandybrown | #F4A460 | |
chocolate | #D2691E | |
saddlebrown | #8B4513 | |
sienna | #A0522D | |
brown | #A52A2A |
HTML is the foundation of webpages, is used for webpage development by structuring websites and web apps. You can learn HTML from the ground up by following this HTML Tutorial and HTML Examples .
HTML HEX Colors Examples
Example 1: In this example, we will print the different hex color codes by using the background color style in the HTML heading tag.
HTML <!DOCTYPE html> <html> <head> <title>HTML Hex Color Codes</title> </head> <body> <h1>Welcome To GeeksforGeeks</h1> <h2 style="background-color:#808000;">#808000</h2> <h2 style="background-color:#CD5C5C;">#CD5C5C</h2> <h2 style="background-color:#FFA07A;">#FFA07A</h2> <h2 style="background-color:#DC143C;">#DC143C</h2> </body> </html>Output:
Example 2: In this example, we will print the different hex color by manipulating hex code in the HTML heading tag.
HTML <!DOCTYPE html> <html> <head> <title>HTML Hex Color Codes Examples</title> </head> <body> <h1>Welcome To GeeksforGeeks</h1> <h2 style="background-color:#FF0000;">#FF0000</h2> <h2 style="background-color:#00FF00;">#00FF00</h2> <h2 style="background-color:#0000FF;">#0000FF</h2> <h2 style="background-color:#FFFF00;">#FFFF00</h2> <h2 style="background-color:#CCEEFF;">#CCEEFF</h2> </body> </html>Output:
#FF0000 – This HTML color code shows just red and no green and no blue. #00FF00 – This HTML color code shows just green and no red and blue. #0000FF – This HTML color code shows just blue and no red and green. #FFFF00 – This HTML color code is a mixture of red and green colors defined as yellow. #CCEEFF – This HTML color code is a mixture of more green and maximum blue provides color like the sky.
Example 3: In this example we will see some hex color color code for the shades of red color with an example.
HTML <!DOCTYPE html> <html> <head> <title>Shades of Red Colors</title> </head> <body> <h1>Welcome To GeeksforGeeks</h1> <h2 style="background-color:#FFA07A;">#FFA07A</h2> <h2 style="background-color:#FA8072;">#FA8072</h2> <h2 style="background-color:#FF0000;">#FF0000</h2> <h2 style="background-color:#8B0000;">#8B0000</h2> </body> </html>Output:
Comment More info Next Article HTML Color CodesK
khushboogoyal499 Follow ImproveTừ khóa » Html Color Codes And Names
-
HTML Color Codes And Names - Computer Hope
-
Color Names - HTML Color Codes
-
HTML Color Codes
-
HTML Color Names - W3Schools
-
HTML Color Groups - W3Schools
-
HTML Color Codes Chart
-
Color In HTML
-
Web Colors - Wikipedia
-
Images: Color Codes - LibGuides At Texas Wesleyan University
-
HTML Color Codes - Dofactory
-
HTML Color Codes
-
HTML Color Names
-
HTML - Color Names - Tutorialspoint