HSB vs HSL vs HSV [英] HSB vs HSL vs HSV

查看:132
本文介绍了HSB vs HSL vs HSV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将Color类作为c ++中非常基本的图形API的一部分.因此,我决定看一下Microsoft的.NET框架,并注意到它们的Color类具有HSB的功能.

然后我开始进行研究,以确定是否应该在班级中提供HSB,HSL或HSV或全部.

所以,我对HSB,HSL,HSV有3个问题:

  1. HSB是否与HSL相同?

  2. 如果没有,为什么没有HSBL甚至HSBLV?

  3. 我发现了许多计算这些值的方法,有人可以告诉我最快的方法吗?

解决方案

HSB是否与HSL相同?

否,HSB与HSV相同,但HSL不同.所有这些都用作表示RGB颜色的友好方式. Wikipedia关于HSL和HSV的文章解释了使用彩色标记的区别: HSL和HSV HSB和HSL的色相基本上相同,但饱和度"取不同的值,亮度"和亮度"也不同.

如果没有,为什么没有HSBL甚至HSBLV?

我不明白这一点. HSB/HSV和HSL都可以代表任何RGB颜色.由于B和L的定义方式,因此不可能单独拥有它们.给定的HSB亮度和饱和度与固定的亮度相关.实际上,它们之间的转换非常容易.

我发现了许多计算这些值的方法,有人可以告诉我最快的方法吗?

这里存在一个类似的问题,用于从RGB计算HSB: HSL vs HSB vs HSV

I am making a Color class as a part of a very basic graphics API in c++. So I decided to take a look at Microsoft's .NET framework and noticed that their Color class has functions for HSB.

Then I started a research to determine whether I should provide HSB, HSL or HSV or ALL of them in my class.

So, I have 3 questions on HSB, HSL, HSV:

  1. Is HSB same as HSL?

  2. If not, why isn't there an HSBL or even HSBLV?

  3. I find many different methods of calculating these values, can someone show me the FASTEST ones?

解决方案

Is HSB same as HSL?

No, HSB is the same as HSV but HSL is different. All these are used as a friendly way to represent RGB colors. The Wikipedia article on HSL an HSV explains the differences using color cilinders: HSL and HSV Basically, Hue is the same for HSB and HSL but the Saturation takes different values and Brightness and Lightness are also different.

If not, why isn't there an HSBL or even HSBLV?

I don't get the point. Both HSB/HSV and HSL can represent any RGB color. Having B and L independently is not possible because of the way they are defined. A given HSB Brightness and Saturation is associated to a fixed Lightness. In fact converting between them is very easy.

I find many different methods of calculating these values, can someone show me the FASTEST ones?

There's a similar question here for calculating HSB from RGB: Fast, optimized and accurate RGB <-> HSB conversion code in C There's a Java implementation there that might help. For converting between HSB/HSV and HSL see HSL vs HSB vs HSV

这篇关于HSB vs HSL vs HSV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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