美文网首页
CSS3 | HSL

CSS3 | HSL

作者: 八宝君 | 来源:发表于2017-06-07 18:20 被阅读0次

HSL

今天在codecademy上学习,发现了一个以前不曾遇见的知识点(是自己看的太少啦),特此记录下来。在codecademy上是这样解释HSL的:

The current revision of CSS, CSS3 (at the time of this writing), introduces a new way to specify colors using HSL colors.

HSL stands for Hue, Saturation, and Lightness. Specifically, this is what each means:

Hue - the technical term that describes what we understand as "color." In HSL, hue is represented on a color wheel. It can take on values between 0 and 360.
Saturation - the amount of gray in a given color. In HSL, saturation is specified using a percentage between 0% and 100%. The percentage 0% represents a shade of gray, whereas 100% represents full saturation.
Lightness - the amount of white in a given color. Similar to saturation, lightness is specified using a percentage between 0% and 100%. The percentage 0% represents black, whereas 100% represents white. 50% is normal.

You can use HSL colors in your CSS like this:
h1 {
  color: hsl(182, 20%, 50%);
}

后来去翻译、查阅了一些资料。HSL是H、S、L:

H:
Hue(色调)。0(或360)表示红色,120表示绿色,240表示蓝色,也可取其他数值来指定颜色。取值为:0 - 360
S:
Saturation(饱和度)。取值为:0.0% - 100.0%
L:
Lightness(亮度)。取值为:0.0% - 100.0%

它和rgb很相似。rgba是包括了透明度的。
而hsl也能拥有透明度,写作hsla()。
注意:由于HSL是CSS3的一部分,旧版浏览器可能不支持。


相关文章

  • CSS3 | HSL

    HSL 今天在codecademy上学习,发现了一个以前不曾遇见的知识点(是自己看的太少啦),特此记录下来。在co...

  • CSS3之HSL

    一、颜色表示法介绍 表示颜色除了十六进制、RGBA,还是HSL(HSLA),其中RGBA及HSA IE9及以上才支...

  • HTML5和CSS3新增内容

    CSS3选择器有哪些? 属性选择器、伪类选择器、伪元素选择器。 CSS3新特性有哪些? 颜色:新增RGBA,HSL...

  • SVG Chapter 3

    资料来源 imooc 慕课网 SVG中的颜色: RGB和HSL 两种颜色表示方法都被CSS3 支持 互相转换的原理...

  • OpenGLES滤镜开发汇总 —— 色彩转换

    RGB转成HSL HSL色彩模式 HSL色彩模式的定义,可以参考百度百科:https://baike.baidu....

  • 颜色的多种表示方式和应用

    色相 HSL style="background-color:hsl(0, 0%, 47%);" 颜色分量解释色相...

  • 常用的 less 颜色操作函数

    hsl 通过色相 (hue),饱和度 (saturation),亮度 (lightness) 三种值 (HSL) ...

  • Cinematic Film Look in Davinci R

    降噪 上LUT 色温调整白平衡 HSL选高光并提亮 HSL选中间调并染青色 HSL选飞机并提亮 高光染橙色,以构建...

  • 零基础学习PS:27最强插件Camera Raw(三)

    这一节我们继续来了解Camera Raw插件的其他基本功能:“HSL”: 红框标记位置,就是“HSL/灰度”的面板...

  • HSL是一种非常直观的色彩表示方法。ACR以及Lightroom中的HSL调整面板,更是我们后期调色的神器。 本文...

网友评论

      本文标题:CSS3 | HSL

      本文链接:https://www.haomeiwen.com/subject/bxsafxtx.html