Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

Colors NCol


NCol Calculator


 
rgb(255, 0, 0)
#ff0000
hsl(0, 100%, 50%)


H:
W:
B:

Natural Colors (NCol)

Natural colors (NCol) is an initiative from W3Schools.

The system is designed to make it easier to select HTML colors.

NCol specifies colors using a color letter with a number to specify the distance (in percent) from the color.

R30 means 30% away from Red , moving towards Yellow. (In other words: Red with 30% Yellow)

LetterColorHues
RRed
R
R25
R50
R75
YYellow
Y
Y25
Y50
Y75
GGreen
G
G25
G50
G75
CCyan
C
C25
C50
C75
BBlue
B
B25
B50
B75
MMagenta
M
M25
M50
M75
R Y G C B M
                                                                                                                       

Color and distance can also be given in hues (0-360):

R = 000 Y = 060 G = 120 C = 180 B = 240 M = 300


HTML Support

NCol is not supported in HTML, but it is very close to the new HWB color system suggested in CSS4.

While waiting for CSS4, you can include W3Schools' Color library, and use NCol as an HTML attribute like this:

Example

<div data-w3-color="R50,50%,0">

<p>London is the capital city of England.
It is the most populous city in the United Kingdom,
with a metropolitan area of over 13 million inhabitants.</p>

</div>

<script src="/lib/w3color.js"></script>
Try It Yourself »

W3Schools Color Library

The JavaScript library used in the example above can be downloaded from

https://w3.p2hp.com/lib/w3color.js


Why NCol?

Trying to explain colors using RGB or HEX notation is very difficult.

Can you tell what color rgb(199,21,133) is?

RGB is based on how to physically produce colors by mixing light sources.

NCol is based on what colors look like to the human eye.

Because of this, NCol makes it much easier to describe colors.

Natural colors were first described by Karl Ewald Konstantin Hering (Germany 1834 - 1918).


×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.