html 颜色代码_HTML颜色(颜色代码)

html 颜色代码

In HTML, color codes are used for representing different colors on the webpage. These colors include the colors which we see as an everyday format that a computer can interpret and display.

在HTML中, 颜色代码用于表示网页上的不同颜色。 这些颜色包括我们视为计算机可以解释和显示的日常格式的颜色。

Naming and remembering all colors is very difficult because each variation differs other just by a small value, therefore some color codes were introduced to make the color finding process easy. The commonly used in color codes include the Hex color-codes, the RGB and the HSL values, and HTML color names, and others, these codes are used in several websites and other software applications.

命名和记住所有颜色非常困难,因为每个变化之间的差异很小,只有一个很小的值,因此引入了一些颜色代码以简化颜色查找过程。 颜色代码中常用的包括十六进制颜色代码 ,RGB和HSL值以及HTML颜色名称,以及其他颜色代码,这些代码用于多个网站和其他软件应用程序中。

HTML中的十六进制颜色代码 (Hex-Color Codes in HTML)

The most popular in the color-coding field is the Hex color codes. Here there three-byte hexadecimal numbers, and with each byte in the hex code represent the intensity of RED, GREEN and BLUE for the color respectively. The proper combination of the intensities of these colors gives the required color, the hex code of the required color.

在颜色编码领域中最流行的是十六进制颜色代码 。 这里有一个三字节的十六进制数字,十六进制代码中的每个字节分别代表颜色的REDGREENBLUE的强度。 这些颜色的强度的适当组合会给出所需的颜色,即所需颜色的十六进制代码。

If we assume X as a hexadecimal number, then the three-byte hex-code of color would be represented as:

如果我们假设X为十六进制数,那么颜色的三字节十六进制代码将表示为:

#XXXXX
Where,
    The first pair of X after the hash "#", represents the RED color.
    The second pair of X represents the GREEN color of the hex code.
    And, the third pair of X represents the BLUE color of the hex-code.

#rrggbb

In the hexadecimal number system, the range of the number is from 0 to F,

在十六进制系统中,数字范围是0到F。

HX = { 0, 1, 2 ,3 ,4, 5, 6, 7, 8, 9, A, B, C, D, E, F } so the hex-code contains the digits in the HX.

HX = {0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F},因此十六进制代码包含HX中的数字。

In the hex codes the values ranging from 00 to FF, where 00 is the lowest intensity for color, and FF represents the highest intensity for a color. In the hex color code, the total number of valid colors is 16,777,216 i.e. 166 color. With #000000 = Black being the first and #ffffff = White being the last.

在十六进制代码中,值的范围是00到FF ,其中00是颜色的最低强度, FF代表颜色的最高强度。 在十六进制颜色代码中,有效颜色的总数为16,777,216,即166 种颜色。 #000000 =黑色为第一个, #ffffff =白色为最后。

HTML中的颜色 (COLORS in HTML)

The white color

白色

The white color is formed by mixing of the three primary colors and that too at their full intensities, thus the resulting Hex color code for white color would be of #FFFFFF.

白色是通过将三种原色以及它们的全部强度混合而形成的,因此,所得的白色十六进制颜色代码将为#FFFFFF 。

The black color

黑色

The Black color is formed at the absence of any color on the display screen, and it is completely opposite to the white color, so for the black color each color is displayed at its lowest intensity and thus the Hex color code is #000000.

黑色是在显示屏上不存在任何颜色的情况下形成的,并且与白色完全相反,因此对于黑色,每种颜色均以其最低强度显示,因此十六进制颜色代码为#000000 。

The Red, Green, and, Blue colors

红色,绿色和蓝色

The three primary colors in hex-code, red, green and blue, could be formed by adding the highest intensity of the desired color with the lowest intensity of the other two colors. For example,

十六进制代码中的三种原色(红色,绿色和蓝色)可以通过将所需颜色的最高强度与其他两种颜色的最低强度相加而形成。 例如,

Color nameCode
Red#FF0000
GREEN#00FF00
BLUE#0000FF
颜色名称
#FF0000
绿色 #00FF00
蓝色 #0000FF

An example based on HTML colors (color codes)

基于HTML颜色(颜色代码)的示例

<html>

<head>
    <title>HTML Color code example</title>
</head>

<body>
    <h1>An example based on HTML colors (color codes)</h1>
    <div style="height:50px;width:300px;background-color:#000000"></div>
    <div style="height:50px;width:300px;background-color:#FFFFFF"></div>
    <div style="height:50px;width:300px;background-color:#FF0000"></div>
    <div style="height:50px;width:300px;background-color:#00FF00"></div>
    <div style="height:50px;width:300px;background-color:#0000FF"></div>
    <div style="height:50px;width:300px;background-color:#006969"></div>
    <div style="height:50px;width:300px;background-color:#006969"></div>
    <div style="height:50px;width:300px;background-color:#F1F1F1"></div>
    <div style="height:50px;width:300px;background-color:#F40000"></div>
</body>

</html>

Output

输出量

HTML color code example output

翻译自: https://www.includehelp.com/html/html-colors.aspx

html 颜色代码

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值