如何修改C#中的颜色亮度? [英] How to modify color brightness in C#?

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

问题描述

在c#中,您可以通过执行Color.GetBrightness()来获取颜色的HSL亮度。如果我想增加一个颜色的亮度一定百分比,我不能简单地乘以单个RGB值的量。看来HSL不工作这样。

解决方案

我认为这篇文章可以帮助你和所有其他颜色相关的问题。它具有所有转换和修改的C#来源



RGB和HSL颜色空间转换


In c#, you can get the HSL brightness of a color by doing Color.GetBrightness(). If I want to increase the brightness of a color by a certain percentage, I cannot simply multiply the individual RGB values by that amount. It seems HSL doesn't work like that. How would I do it?

解决方案

I think this article can help you with this and all other color related quesitons. It has C# source for all conversions and modifications

RGB and HSL Colour Space Conversions

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

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