颜色 - 为什么 CSS3 的 hsl 色彩模式很少被使用?
迷茫
迷茫 2017-04-17 11:11:05
0
6
857
color:hsl(120,65%,75%)

色相,饱和度,亮度的hsl记法相比rgb更难理解吗?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(6)
巴扎黑

Maybe it’s for historical reasons. After all, in the w3c specification, the earliest color space was rgb, and the rgb color space based on the additive principle is more friendly to the display, because the display's channel happens to be three rgb channels.

Correspondingly, cmyk is a color space based on the subtraction principle. Due to the impossibility of completely uniform physical mixing of pigments and ambient light issues, cmyk may be darker than the corresponding rgb space color in actual applications (such as Prints of the same painting tend to appear darker than displays).

However, rgb/rgba are not friendly colors to humans, especially artists. If you have studied art, you must often talk about what color, what brightness, what purity (saturation) this color has, but not how many levels of blue and red this color has. If someone creates directly with css, these hsl attributes can still help. Moreover, HSL is indeed more accurate than RGB in expressing brightness. Of course, this "accuracy" is at the physical level. At the mathematical level, the three color spaces of RGB, CMYK, and HSL can of course be converted to each other.

Another one is that the hsl color space can be used with css3 animation. For example, HSL is obviously more convenient to express the change of the same hue from light to dark.

In terms of film and television post-production special effects production, HSL color space is used more. I wonder if CSS animation will become as complex as American science fiction blockbusters in the future, and HSL will be used on a large scale.

Final complaint: In fact, w3c might as well include the yuv color space unit in the standard...

PHPzhong

Isn’t it because of compatibility?

大家讲道理

Because the pages are all from PSD and other design drafts, if it is a color value, it is obtained directly through the color picking software, which is usually a hexadecimal color. Now for some transparent convenience, an RGBA method is added to represent it. Therefore, these two methods are much more popular than HSL.

Then there is also the HSL method, which requires a certain understanding of the three color modes of H, S, and L before it can be operated. Specifically, it is necessary to determine which color value is better based on the project requirements.

Here is a little thing that I used to do in HSL a long time ago. The code is terrible...
http://lab.tianyizone.com/color.html

洪涛

Compatibility, as well as transparency, RGB and RGBA beat HSL

洪涛

RGB mode, I can easily imagine various color ratios, and know how to make it redder and bluer,
You asked me to remember the hue, how should I do it?

大家讲道理

RGB and RGB are the mainstream ones, W3C recommends this

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template