Daniel
03/07/2021, 3:42 PMBlendMode.SrcIn
appear to be incorrect.
Show the source image, but only where the two images overlap.
The destination image is not rendered, it is treated merely as a mask.
The color channels of the destination are ignored, only the opacity has an effect
The color channels of the destination are used. Assuming this just wraps the native equivalent, this would be the expected behavior.
Asking here to check I'm not missing something stupid before I file a bug.romainguy
03/07/2021, 6:03 PMDaniel
03/07/2021, 6:05 PMCanvas {
drawIntoCanvas {
it.nativeCanvas.drawText(text, textPadding, baseline, paint)
}
drawRect(
Brush.linearGradient(0f to Color.Transparent, 1f to Color.Blue),
size = Size(sizePx.width, turnSpace),
blendMode = BlendMode.SrcIn
)
}
romainguy
03/07/2021, 6:10 PMDaniel
03/07/2021, 6:10 PMromainguy
03/07/2021, 6:11 PMDaniel
03/07/2021, 6:11 PMSpacer(
Modifier
.size(size.x, size.y)
.graphicsLayer()
.drawBehind {
drawIntoCanvas {
it.nativeCanvas.drawText(text, textPadding, baseline, paint)
}
drawRect(
Brush.linearGradient(0f to Color.Transparent, 1f to Color.Blue),
size = Size(sizePx.width, turnSpace),
blendMode = BlendMode.SrcIn
)
romainguy
03/07/2021, 6:11 PMDaniel
03/07/2021, 6:12 PMromainguy
03/07/2021, 7:49 PMDaniel
03/07/2021, 8:18 PMromainguy
03/08/2021, 12:35 AM