十六进制颜色如何工作? [英] How does hexadecimal color work?

查看:146
本文介绍了十六进制颜色如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

代表CSS颜色的十六进制是什么意思?我怎么知道什么颜色是没有记住确切的代码?它与RGB(和CMYK)系统有任何关系吗?

我想了一会儿, FF 表示 255 在RGB,但后来我意识到15 ^ 2不是255,但225。

解决方案

十六进制使用十六个不同的符号,在css颜色的情况下,符号 0-9 表示零到九,以及 A,B,C,D,E,F



有了两个十六进制,你可以用十六进制表示十六进制。可以表示16 * 16个值(= 256个值)



在RGB中你有(R = 0-255,G = 0-255,B = 0-255)我们使用3对十六进制符号!



所以当你看到一个RGB颜色,你可以做这个计算:



例如:Hex: #fefafd 是RGB: 254,250,253



由于 fe = 254 (红色), fa = 250 (绿色), fd = 253 (蓝色)!



希望它有助于您的理解!



更多阅读:十六进制维基百科和一个不错的RGB到十六进制 Converter


What does the hexadecimal that represents a CSS color mean? How can I tell what color it is without memorizing the exact code? Does it have any relationships with RGB (and CMYK) system?
I thought for a moment that FF means 255 in RGB, but then I realized that 15^2 isn't 255, but 225.

解决方案

Hexadecimal uses sixteen distinct symbols, in the case of css color the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen.

So with one Hexadecimal you can represent 16 values.

With two Hexadecimal you can represent 16*16 values (=256 values)

In RGB you have (R=0-255,G=0-255,B=0-255) so we use 3 pairs of Hexadecimal symbols!

So when you see an RGB color, you can make this calculation:

For example: Hex: #fefafd is RGB: 254,250,253.

Because fe=254(Red), fa=250(Green), fd=253(Blue)!

Hope it helps your understanding!

More to read: Hexadecimal on Wikipedia and a nice RGB to Hexidecimal Converter

这篇关于十六进制颜色如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆