菜单
×
   ❮     
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 计算器


 
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颜色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).


×

联系销售

如果您想将 W3Schools 服务用于教育机构、团队或企业,请发送电子邮件给我们
sales@w3schools.com

报告错误

如果您想报告错误,或想提出建议,请发送电子邮件给我们
help@w3schools.com

W3Schools 经过优化,旨在方便学习和培训。示例可能经过简化,以提高阅读和学习体验。教程、参考资料和示例会不断审查,以避免错误,但我们无法保证所有内容的完全正确性。使用 W3Schools 即表示您已阅读并接受我们的使用条款Cookie 和隐私政策

版权所有 1999-2024 Refsnes Data。保留所有权利。W3Schools 由 W3.CSS 提供支持