Blend Modes
source - view that comes with the blending effect.
destination - everything underneath that view.
source : pixels being applied (blend modes)
destination: pixels already stored to the context
R : result of blend operation
S : source pixel values
Sa: source alpha
D : destination pixel values
Da: destination alpha
// blend modes:
R = S ร Sa + D ร (1 โ Sa) // normal
R = S ร Da // source in
R = S ร (1 โ Da) // source out
R = S ร Da + D ร (1 โ Sa) // source atop (?)
R = S ร (1 โ Da) + D // destination over
R = D ร Sa // destination in
R = D ร (1 โ Sa) // destination out
R = S ร Da + D ร (1 โ Sa) // destination atop (?)
.destinationOut - ๆๆด็จ็ๆๆใ
GraphicsContext โฉ GraphicsContext.BlendMode โญ๏ธ
Core Image โฉ CIBlendKernel - โญ๏ธ ๆๆฏๅๆททๅๆจกๅผ็ๅไพ (ไฝ็บไฝ็จฑ็บ blend kernelโ)
SwiftOnTap โฉ View โฉ .colorMultiply(_:)
Last updated