Colors NCol
NCol 计算器
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 | 颜色 | Hues |
---|---|---|
R | 红色 |
R
R25
R50
R75
|
Y | 黄色 |
Y
Y25
Y50
Y75
|
G | 绿色 |
G
G25
G50
G75
|
C | 青色 |
C
C25
C50
C75
|
B | 蓝色 |
B
B25
B50
B75
|
M | 洋红色 |
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 支持
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
示例
<div data-w3-color="R50,50%,0">
<p>伦敦是英格兰的首都。
它是英国人口最多的城市,
都市区有超过 1300 万居民。</p>
</div>
<script src="/lib/w3color.js"></script>
自己试试 »
W3Schools 颜色库
上述示例中使用的 JavaScript 库可以从以下网址下载
https://w3schools.org.cn/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).