Harley-xk / MaLiang

iOS painting and drawing library based on Metal. 神笔马良有一支神笔(基于 Metal 的涂鸦绘图库)
MIT License
1.47k stars 208 forks source link

Brush color and multiply #126

Closed ant3dstudio closed 2 years ago

ant3dstudio commented 2 years ago

How to set the color for the ChartletBrush?

How to remove the blending of a brush?

Thanks!))

Harley-xk commented 2 years ago

Color of Chartlet Brush Can't be changed now, It‘s only used to print images to canvas. Also, blendings can't be removed too. Instead, you can override the setupBlendOptions method on your own brush.

ant3dstudio commented 2 years ago

yes, I change the color of the brush, just paint over the image with a color, but I can not figure out how to apply the fill to the texture in the class.

setupBlendOptions - not applicable, I can't figure out what's wrong.

Can you tell me what parameters should be applied so that the brush draws like ChartletBrush?

Thanks!

Harley-xk commented 2 years ago

If you want to make your own chartlet brush, just extends your brush from the Printer class, like the ChartletBrush class do. In the Printer there are all settings for your needs, not only blend options, but also shader functions.