Does the .Net Color struct use an HSB or HSL colour space?

断了今生、忘了曾经 提交于 2019-11-30 12:43:18

The page you linked to gives examples of L and V (aka B) for a range of colours. Comparing the result of Color.FromArgb(255, 255, 0, 0).GetBrightness (0.5) to the examples shows that .NET is using the HSL model. A check of Color.FromArgb(255, 128, 255, 255).GetSaturation (1.0) confirms it.

Others have discovered the same thing, e.g. Chris Jackson (MSFT) in Converting from HSB to RGB in .NET: "The underlying issue is that the .NET Framework refers to the color space as HSB even though it actually is HSL. (The color picker control refers to it correctly.) The Color structure in the framework provides a GetBrightness() method, described in the documentation as, "Gets the hue-saturation-brightness (HSB) brightness value for this Color structure." Is this wrong? You bet. It should be called GetLuminance()."

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!