如何改变RGB颜色HSV? [英] How to change RGB color to HSV?

查看:316
本文介绍了如何改变RGB颜色HSV?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何改变RGB颜色为HSV?在C#语言。
我搜索了非常快速的方法,无需任何外部库。

How to change RGB color to HSV? In C# language. I search for very fast method without any external library.

推荐答案

你有没有考虑使用简单System.Drawing命名空间?例如:

Have you considered simply using System.Drawing namespace? For example:

System.Drawing.Color color = System.Drawing.Color.FromArgb(red, green, blue);
float hue = color.GetHue();
float saturation = color.GetSaturation();
float lightness = color.GetBrightness();

请注意,这不是你问什么了(见HSL和HSV 和Color类之间区别呢没有转换从HSL / HSV回,但后者是合理容易添加

Note that it's not exactly what you've asked for (see differences between HSL and HSV and the Color class does not have a conversion back from HSL/HSV but the latter is reasonably easy to add.

这篇关于如何改变RGB颜色HSV?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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