开发者

gtk.gdk: make image 50% grayer

开发者 https://www.devze.com 2023-02-09 06:38 出处:网络
I have an开发者_如何学编程 image wiht gtk.gdk. I want to make it look grayed out, so I wanna do something like draw a gray rectangle over it with 50% alpha value. How would I do this? The docs are so

I have an开发者_如何学编程 image wiht gtk.gdk. I want to make it look grayed out, so I wanna do something like draw a gray rectangle over it with 50% alpha value. How would I do this? The docs are so confusing.


i just thought of a way taking half of the color's highest values and taking half of the number directly between them and putting that on the lowest number (Eg: 0,255,255 to 127,255,255 or 0,127,255 to 96,127,255) or taking the second highest number and the highest number, finding the 50%, putting that as the second highest number, then doing that again for the absolute lowest number (Eg: 0,128,255 > 112,192,255) hope this works for me and for you, right now im recommending to myself and you, the second option, however if you're lazy, the first option is less work

0

精彩评论

暂无评论...
验证码 换一张
取 消