简体   繁体   English

ANDROID:Color和Hue的等效混合模式(porter duff)是什么

[英]ANDROID: what is the equivalent blend modes (porter duff) for Color and Hue

I'm trying to create an effect that I saw in an IOS application where the they used a blend mode of color and one of hue, but I couldn't find those blend modes in the PorterDuff.modes enum. 我正在尝试创建一个我在IOS应用程序中看到的效果,它们使用混合模式的颜色和一个色调,但我无法在PorterDuff.modes枚举中找到这些混合模式。 Do you know if there are equivalent modes in android? 你知道android中是否有相同的模式? Thanks! 谢谢!

It depends exactly what you're trying to do; 这完全取决于你想要做什么; depending on the color used, you could use PorterDuff.Mode.MULTIPLY or SRC_OVER ; 根据使用的颜色,您可以使用PorterDuff.Mode.MULTIPLYSRC_OVER ; hue is a little more complex. 色调有点复杂。

If none of the modes suit your needs (because, no, there are no default color/hue PorterDuff modes), this answer may tickle your fancy. 如果这些模式都不适合您的需求(因为,没有,没有默认的颜色/色调PorterDuff模式), 这个答案可能会让您感到惊讶。 It's basically adjusting the hue of a ColorMatrix , which can then be applied to a Drawable . 它基本上调整了ColorMatrix的色调,然后可以将其应用于Drawable (That process is elaborated on in the preceding answer's OP.) (这个过程在前面的答案的OP中详细阐述。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM