Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/a26f9f83/public_html/articles/includes/config.php on line 159
Hexadecimal Color Notation on the Web > NetSparsh - Viral Content you Love & Share

Hexadecimal Color Notation on the Web

When designing elements for your webpage, you will often be called upon to specify a color. For example, the code for a span shown below specifies that the color of the text within the span will be yellow.

Text

Colors can be specified according to their names, for example "yellow", "green", or "blue". In many cases, these simple color names will work. But what if you want to specify a more sophisticated color like "cornflowerblue"? A particular browser may not recognize a particular color name. It's more reliable to specify colors with an "RGB triplet".

An RGB triplet specifies a color based upon the amounts of red, green, and blue, on a scale from 0 to 255, required to create the color. For example, to create the color cornflowerblue you need red=100, green=149, and blue=237. We could then specify the color of the text within a span using the rgb function as shown below.

Text

This will work fine with style notation, but what if you want to use straight html. Html doesn't recognize the rgb function. In that case, you can specify color using "hexadecimal" notation. Whereas the decimal numbering system uses the characters 0 through 9 to get 10 values, the hexadecimal numbering system uses the characters 0 through f to get 16 values. (After 9 the characters a, b, c, d, e and f are used, as shown below.)

Decimal Hexidecimal Equivilants

dec hex

0 = 0

1 = 1

2 = 2

3 = 3

4 = 4

5 = 5

6 = 6

7 = 7

8 = 8

9 = 9

10 = A

11 = B

12 = C

13 = D

14 = E

15 = F

On first appearance, this looks pretty simple but you need two hexadecimal characters to represent all decimal values from 0 to 255. When you increment decimal 9 by 1, you change the 9 to 0 and put 1 in the ten's place. When you increment hexidecimal F by one, you change the F to 0 and put 1 in the "sixteens" place. Sometimes it's not easy to convert between decimal and hexadecimal in your head.

RGB Triplet for Cornflowerblue

color dec hex

red 100 64

green 149 95

blue 237 ED

We could then specify the color of text within a span using the hexadecimal notation as shown below.

Text

Note that when we indicate the use of hexadecimal notation by placing a pound (#) sign in front of the number, and we don't use commas to separate the color components.

If it's not easy to convert between decimal and hexadecimal in your head, then how do you do it? You can use a calculator that has a decimal to hexadecimal coversion function, or you can learn to think in hexadecimal. For example, what's the next number after CE? That would be CF. what's the next number after CF? That would be D0. Which hexadecimal number is higher 99 or B2? B2 would be higher than 99. It gets easier with experience.

Here's Java Script code for a simple decimal to hexidecimal color converter

function convert(decvalue)

{

var num = parseInt(decvalue);

if(num >= 0 && num < 256)

{

var hexnum = num.toString(16);

alert("#" + hexnum);

}

else {alert("Error!");}

}

It's important to use hexadecimal notation to specify colors when you use DHTML with visual effects, because to create a dynamic color change you have to increment or add a value to a color. The vast amount of color specification on webpages is in hexadecimal notation, so it would be wise to become familiar with it.

Copyright(C) Bucaro TecHelp.

Permission is granted for the below article to forward, reprint, distribute, use for ezine, newsletter, website, offer as free bonus or part of a product for sale as long as no changes are made and the byline, copyright, and the resource box below is included.

About The Author

To learn how to maintain your computer and use it more effectively to design a Web site and make money on the Web visit bucarotechelp.com. To subscribe to Bucaro TecHelp Newsletter visit http://bucarotechelp.com/search/000800.asp

In The News:

This RSS feed URL is deprecated, please update. New URLs can be found in the footers at https://news.google.com/news

7 Upcoming E-commerce Web Design Trends to Adopt in 2018
Customer Think
With the advancement in the technology, most of the individuals have just forgotten the time when they used to buy the things manually. Now the businesses are coming online with the e-commerce website. In this era of modernity, most of the individuals ...


Forbes

Webflow, The Web Design Amalgam Of WordPress And Photoshop, Releases Interactions 2.0
Forbes
Webflow at first glance is just another internet tool for designing web pages. After you blink and start scrolling, you'll quickly release the comprehensive tool in front of you. Webflow is an all-in-one web design platform for designing and launching ...


Popular Science

Master web design with 57 hours of training for $29
Popular Science
With over 140,000 websites launched each day, web design is a pretty solid career. What's more, you can use the same skills to create apps and launch your own startup. The Learn to Design Bundle helps you chase these goals, with nine courses and 57 ...


B2B Research Company GoodFirms Announces Top Web Design ...
Business Wire (press release)
Today, GoodFirms revealed the top web design companies globally. A highly reputed B2B research, rating and review platform - GoodFirms covers the most.

and more »

Business 2 Community

It's Not My Font – The Importance of Typography in Web Design
Business 2 Community
Typography accounts for 90% of website design. The main reason that people visit a website is to read text, whether this means finding information about the company or reading your content. The words on your website matter, so, the way in which you ...


The Mary Sue

Everything You Need to Learn Web Design … for $29
The Mary Sue
Budding web designers, diving into all the tools and skills you need to start making your own apps and sites can be overwhelming. So we're taking care of the what and how for you—pick up the Learn to Design Bundle for $29 at the Mary Sue Shop. Less ...


TG Daily (blog)

The Impact of WebDesign on Marketing, Branding and conversions
TG Daily (blog)
Most business owners agree that high-quality web design is essential for their business. But when asked exactly why it's important, only a few could provide an adequate answer. Web design isn't all about aesthetics. There's no use to adding all the ...


San Antonio Business Journal

Local web development company acquired in $1M deal
San Antonio Business Journal
A West Coast company is acquiring another San Antonio-based digital marketing and web design company, the business announced. CloudCommerce Inc., based in Santa Barbara, California, is expected to pay up to $1 million in stock for WebTegrity, ...


TG Daily (blog)

4 Web Design Tips for Small Businesses on a Very Limited Budget
TG Daily (blog)
If you're like a lot of small businesses, you're operating on a shoestring budget. An internet presence is essential in the digital age, and if your budget is lacking, you may be considering making your own website. You might not be a developer that ...


SitePoint

5 Top Web Apps for Your Web Design Workflow
SitePoint
This article was sponsored by BAWMedia. Thank you for supporting the partners who make SitePoint possible. Your talent and creative instincts can take you a long way. Nevertheless, the web design process requires dedication and perseverance on top of ...

Google News

What is ASP.NET

ASP.NET is a new programming framework from Microsoft for developing... Read More

12 Essential Web Site Design Tips

1. What's the purpose?The most fundamental thing to do before... Read More

How To Rescue Your Graphic Design Project When All Else Fails

Whether you're giving a critical sales presentation to a client,... Read More

You Too Can Have an Amazing Website

It is a well-known fact that a successful business depends... Read More

Welcoming Your Website Visitors

Imagine you're going on a blind date. You've heard wonderful... Read More

Double Ad-Trackers Its Not as Crazy as It Sounds Here Are 7 Reasons Why?

A Double Ad Tracker is an Ad-Tracker that points to... Read More

Branding Web Strategy Mistakes - Brand Identity Guru

1. Lack of overall strategy and clear definition of success:Most... Read More

Create A Web Site That Builds Trust

If someone doesn't know you personally, will they trust you... Read More

How To Set Up A Professional Website On Your Own Using Web Templates

To create professional websites is not an easy task by... Read More

File Types For Icons Explained

An application is not ready for use unless you have... Read More

Dos and Donts in Web Design - part 2 (content)

Do know your audienceIt's important to know your audience. If... Read More

Professional Web Design Companies - How to Avoid Getting Ripped Off

Building a website that is exactly what you want and... Read More

5 Easy Ways to Improve Your Website

When designing your website, remember to avoid useless and confusing... Read More

Top Ten Ways to Increase Web Sales - Part 2

You have only 10 seconds to impress your potential buyer.... Read More

Using Graphic Design on Your Website

Almost everything is available on the web? products, services, e-books,... Read More

How to Convince Your Visitors to Return Often

One visit does not make a sale. Be sure to... Read More

10 Tips for Killer Website Design

Does website design make a difference in how long people... Read More

Website Design Mishaps - How to Avoid Costly Errors That Can Crush Your Chances of Success

Designing your website can be a difficult task especially if... Read More

How To Choose The Right Web Design Company

1. Size does not equate to competencePeople sometimes assume a... Read More

The Testimonial Trick

One of the most popular methods of traffic generation is... Read More

Understand Your Color

Any design on a web application involves the effective input... Read More

Does Your Homepage Work?

All websites have a homepage. It is the most important... Read More

Keep Your Navigation Consistent!

One of the single most important aspects of effective navigation... Read More

Tableless Web Designs: Why I Switched

Since I made the switch 6 months ago to a... Read More

Design Matters in our Visual Culture

FIRST IMPRESSIONS. First impressions often leave lasting impressions. Impressions... Read More