W3C中文教程
全球最大最新的中文 Web 技术教程
HTML CSS SQL PHP COLORS MYSQL BOOTSTRAP
 

Colors NCol


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)

Letter Color Hues
R Red
R
R25
R50
R75
Y Yellow
Y
Y25
Y50
Y75
G Green
G
G25
G50
G75
C Cyan
C
C25
C50
C75
B Blue
B
B25
B50
B75
M Magenta
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 (yet), 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="http://www.w3schools.com/lib/w3colors.js"></script>
Try It Yourself >>

W3Schools Color Library

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

http://www.w3schools.com/lib/w3colors.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).