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

Base Element Wins 3 Silver W³ Awards for Web Design Excellence
Benzinga
In its thirteenth season, the W³ Awards received over 5,000 entries from Advertising agencies, PR Firms, Interactive Agencies, In-house creative professionals, Web Designers, Graphic Designers, and Web Enthusiasts. The W³ is sanctioned and judged by ...

and more »

New York Web Design Company, Lounge Lizard, Discusses Quick Tips to Optimize for Voice Search
PR Newswire (press release)
NEW YORK, Oct. 19, 2018 /PRNewswire/ -- Lounge Lizard is globally recognized as a top New York Web Design Company within the web design and development industry. Lounge Lizard's brand tenders are creative, tech-savvy, and passionate in ...


Web Design Company, Lounge Lizard, Shares an Effective 7-Step UX Testing Plan
PR Newswire (press release)
NEW YORK, Oct. 18, 2018 /PRNewswire/ -- Lounge Lizard is globally recognized as a top Web Design Company within the web design and development industry. Lounge Lizard's brand tenders are creative, tech-savvy, and passionate in developing ...

and more »

Fast Company

The future of web design is less, not more
Fast Company
The internet is a system that demands more: more engagement, more clicks, more ads, more content, more code, more servers, and more devices. The size of a typical web page has increased exponentially in recent years. Thirty-nine percent of young ...


Project6 Receives 2018 WebAward for Outstanding Achievement in Web Design and Development for CrossFit Games
Markets Insider
EMERYVILLE, Calif., Oct. 18, 2018 /PRNewswire-PRWeb/ -- San Francisco Bay Areawebsite design and development company Project6 is proud to announce that it has been awarded the 2018 WebAward for Outstanding Achievement in Web Design and ...

and more »

Pacific Standard

We're Hiring an Art & Design Director
Pacific Standard
A background in visual design with an appreciation for the finer arts of typography, layouts, and spacing. Four-plus years work experience, ideally in Web design, UX/UI design, and/or front-end development. Knowledge of HTML CSS (ideally including ...


Search Engine Journal

How to Combine Usability & Beauty for an Awesome Website Design
Search Engine Journal
Unfortunately, iconography in web design is about as usable as an Ed Hardy shirt. You can make it work. Pair it with the right elements, and it might even elevate your site. But more often than not, they're the equivalent of that bedazzled flaming ...


Adweek

This New Tool Makes Eye-Tracking Tech More Accessible to Web Designers
Adweek
At least that's the premise of an increasingly popular practice among web designers and advertisers: the use of biometric technology to track and test consumer's eyes as they roam around a screen. Proponents say these devices, which range from infrared ...


Franklin County School Board must pay $11000 to web design firm
Roanoke Times
In its initial filing, HD Web Design sought $17,332.44, or half of the total project cost. But after Maddy filed a motion for summary judgment, the complaint was amended to seek $11,252.75 for the work that had been completed at the time of cancellation.

and more »

Web Design Company, Lounge Lizard, talks about 5 ways Great Web Design enhances your CX
PR Newswire (press release)
Great web design also directly influences conversions, which is a very important part of the customer experience. Why does a customer go to any website? The answer is to solve a problem or fulfill a need. If your site is not converting visitors ...

Google News

Making Good Websites that Stand Out

Websites, there's literally billions of them out there in cyber-space.... Read More

Do Your Website Yourself - 4 Simple Steps to Get Your Dreams on the Web

Many people hire professional web site designers for as much... Read More

Create Favorite Icon

Favorite icon appears to the left of your link in... Read More

How To Attract People To Your Web Site and Leave Their Contact

If you have a website, you want your visitors to... Read More

How to Make Effective Use of Web Fonts

Writing for your web site is not the same as... Read More

Handwriting Font Tips - The Personal Touch That Makes a Difference

Most websites use similar fonts and as a result have... Read More

Make Your Site Quick To Load!

The time it takes to load your site can make... Read More

The Next Marketing Tool: Deisgn

Design sells. It's something that all of us know, but... Read More

6 Reasons Why Using Flash is a BIG Mistake

Most web designers and web design companies will try to... Read More

Website Design: 10 Web Site Design Pitfalls To Avoid

If you've a website that is not generating a lot... Read More

Understanding How HTML Color Codes Work

Ever wonder how HTML color codes are put together? For... Read More

Building Web Sites Using Web Templates

Gone are the days when you had to rely on... Read More

Creating a Compelling Headline for Your Private Practice Website

Your home page is the most important page of your... Read More

Ten Fatal Mistakes That Make Web Sites Stink

Since you'll spend lots of time and money to create... Read More

Online Businesses Still Ignoring Dial-up Market

In this article you will find the parallel between two... Read More

Freelancers Bite Back!

The Internet has seen an explosion in so called 'lance'... Read More

Developing An Effective Physical Therapy Web Site

Physical therapists have unique web presence needs. An effective site... Read More

Imitation, The Smartest Form Of Flattery

Unless you are an inventor, most likely you are selling... Read More

Maximising Web Site Viewability - Resolution

This is my second article on maximising web site viewability.... Read More

What to Avoid to Make Your Website Design Effective

The effective design is this one, which is maximum simplified,... Read More

The Seven Deadly Sins of Web Business Design

Before you take a road trip it is usually a... Read More

10 Tips for Killer Website Design

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

How to Chose Stock Photography for your Web Site

So you've decided to take the plunge. You know that... Read More

Website Advertising: 10 Dynamic Tactics To Super-Charge Your Sales

Here are 10 dynamic website advertising tactics to super-charge your... Read More

Why is a Logo so Important to Your Business?

Well, a logo for your business. Why is it important?... Read More