What are the HTML Color Code & Names?

Colors play a crucial role in web development, influencing both the aesthetic appeal and usability of a website. HTML supports a variety of color codes and names that allow developers to specify colors for backgrounds, text, borders, and other elements. Understanding these color codes and names is essential for creating visually appealing web pages.

In this guide, we will explore the different types of HTML color codes, a comprehensive list of color names, and how to implement them in your web projects.

Types of HTML Color Codes

HTML supports several ways to define colors:

1. Hexadecimal Color Codes

Hexadecimal color codes, often referred to as “hex codes,” use a six-digit combination of numbers and letters prefixed by a #. Each pair of digits represents the intensity of red, green, and blue (RGB) values.

Example:

  • #FF0000 (Red)
  • #00FF00 (Green)
  • #0000FF (Blue)

2. RGB Color Codes

RGB color codes define colors using the Red, Green, and Blue components, with values ranging from 0 to 255.

Example:

  • rgb(255, 0, 0) (Red)
  • rgb(0, 255, 0) (Green)
  • rgb(0, 0, 255) (Blue)

3. RGBA Color Codes

RGBA extends the RGB format by adding an alpha (A) component for transparency, where 0 is fully transparent and 1 is fully opaque.

Example:

  • rgba(255, 0, 0, 0.5) (Semi-transparent Red)

4. HSL and HSLA Color Codes

HSL (Hue, Saturation, Lightness) and HSLA (Hue, Saturation, Lightness, Alpha) offer an alternative way to define colors.

Example:

  • hsl(0, 100%, 50%) (Red)
  • hsla(0, 100%, 50%, 0.5) (Semi-transparent Red)

Most used HTML color names and codes

You can utilize both the color names and codes provided below to incorporate these common colors into your design.

Color NamesColor CodeColor NameColor Code
Red#FF0000White#FFFFFF
Cyan#00FFFFSilver#C0C0C0
Blue#0000FFGray or Grey#808080
DarkBlue#00008BBlack#000000
LightBlue#ADD8E6Orange#FFA500
Purple#800080Brown#A52A2A
Yellow#FFFF00Maroon#800000
Lime#00FF00Green#008000
Magenta#FF00FFOlive#808000
Pink#FFC0CBAquamarine#7FFFD4

HTML Color code chart

Color CodeColor Name
#000000Black (W3C)
#0C090ANight
#34282CCharcoal
#3B3131Oil
#3A3B3CDark Gray
#454545Light Black
#413839Black Cat
#3D3C3AIridium
#463E3FBlack Eel
#4C4646Black Cow
#504A4BGray Wolf
#565051Vampire Gray
#52595DIron Gray
#5C5858Gray Dolphin
#625D5DCarbon Gray
#666362Ash Gray
#696969DimGray or DimGrey (W3C)
#686A6CNardo Gray
#6D6968Cloudy Gray
#726E6DSmokey Gray
#736F6EAlien Gray
#757575Sonic Silver
#797979Platinum Gray
#837E7CGranite
#808080Gray or Grey (W3C)
#848482Battleship Gray
#8D918DGunmetal Gray
#A9A9A9DarkGray or DarkGrey (W3C)
#B6B6B4Gray Cloud
#C0C0C0Silver (W3C)
#C9C0BBPale Silver
#D1D0CEGray Goose
#CECECEPlatinum Silver
#D3D3D3LightGray or LightGrey (W3C)
#DADBDDSilver White
#DCDCDCGainsboro (W3C)
#E5E4E2Platinum
#BCC6CCMetallic Silver
#98AFC7Blue Gray
#838996Roman Silver
#778899LightSlateGray or LightSlateGrey (W3C)
#708090SlateGray or SlateGrey (W3C)
#6D7B8DRat Gray
#657383Slate Granite Gray
#616D7EJet Gray
#646D7EMist Blue
#566D7EMarble Blue
#737CA1Slate Blue Grey
#728FCELight Purple Blue
#4863A0Azure Blue
#2B547EBlue Jay
#36454FCharcoal Blue
#29465BDark Blue Grey
#2B3856Dark Slate
#123456Deep-Sea Blue
#151B54Night Blue
#191970MidnightBlue (W3C)
#000080Navy (W3C)
#151B8DDenim Dark Blue
#00008BDarkBlue (W3C)
#15317ELapis Blue
#0000A0New Midnight Blue
#0000A5Earth Blue
#0020C2Cobalt Blue
#0000CDMediumBlue (W3C)
#0041C2Blueberry Blue
#2916F5Canary Blue
#0000FFBlue (W3C)
#0002FFSamco Blue
#0909FFBright Blue
#1F45FCBlue Orchid
#2554C7Sapphire Blue
#1569C7Blue Eyes
#1974D2Bright Navy Blue
#2B60DEBalloon Blue
#4169E1RoyalBlue (W3C)
#2B65ECOcean Blue
#306EFFBlue Ribbon
#157DECBlue Dress
#1589FFNeon Blue
#1E90FFDodgerBlue (W3C)
#368BC1Glacial Blue Ice
#4682B4SteelBlue (W3C)
#488AC7Silk Blue
#357EC7Windows Blue
#3090C7Blue Ivy
#659EC7Blue Koi
#87AFC7Columbia Blue
#95B9C7Baby Blue
#6495EDCornflowerBlue (W3C)
#6698FFSky Blue Dress
#56A5ECIceberg
#38ACECButterfly Blue
#00BFFFDeepSkyBlue (W3C)
#3BB9FFMidday Blue
#5CB3FFCrystal Blue
#79BAECDenim Blue
#82CAFFDay Sky Blue
#87CEFALightSkyBlue (W3C)
#87CEEBSkyBlue (W3C)

Using HTML Color Codes in Web Development

You can use color codes in CSS and HTML to style various elements. Here are some examples:

1. Using Hex Codes in CSS

Using Hex Codes in CSS
Using Hex Codes in CSS

2. Using RGB and RGBA Codes in CSS

Using RGB and RGBA Codes in CSS
Using RGB and RGBA Codes in CSS

3. Using HSL and HSLA Codes in CSS

Using HSL and HSLA Codes in CSS
Using HSL and HSLA Codes in CSS

Tips for Choosing the Right Colors

  • Use Web-Safe Colors: Ensure colors appear consistently across different devices and browsers.
  • Check Contrast Ratio: Make sure text is readable against its background for accessibility.
  • Use Online Color Pickers: Tools like Adobe Color or Coolors can help find harmonious color schemes.
  • Test on Multiple Devices: Colors may appear differently on different screens.

Conclusion

HTML color codes and names form the foundation of web design’s visual language. Whether you prefer working with hexadecimal codes for precision or color names for readability, understanding these standards is essential for creating visually appealing and accessible web experiences.

As you develop your web projects, experiment with different color combinations while maintaining accessibility standards. Remember that effective use of color can significantly impact user experience, brand perception, and the overall success of your website.

By mastering HTML color codes and names, you’ll add a powerful tool to your web development toolkit, enabling you to create visually stunning and effectively branded web experiences.

READ NEXT:

Back to top button