typemytype / drawbot

http://www.drawbot.com
Other
398 stars 61 forks source link

uncommon blendModes #479

Open frankrolf opened 2 years ago

frankrolf commented 2 years ago

What do the blend modes clear, copy, sourceIn, sourceOut, sourceAtop, destinationOver, destinationIn, destinationOut, destinationAtop, xOR, plusDarker, plusLighter actually do? Not anything, as per my testing:

blend_modes = ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'colorDodge', 'colorBurn', 'softLight', 'hardLight', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity', 'clear', 'copy', 'sourceIn', 'sourceOut', 'sourceAtop', 'destinationOver', 'destinationIn', 'destinationOut', 'destinationAtop', 'xOR', 'plusDarker', 'plusLighter']

for blend_mode in blend_modes:
    newPage(100, 100)
    blendMode(blend_mode)
    fill(1, 0, 0, 1)
    rect(10, 10, 70, 70)
    fill(0, 0, 1, 1)
    rect(20, 20, 70, 70)
    fill(1)
    blendMode('normal')
    font('.SFNSMono-Regular')
    text(
        blend_mode,
        (width()/2, height()/2),
        align='center'
    )
typemytype commented 2 years ago

see https://developer.apple.com/documentation/coregraphics/cgblendmode?language=objc

some work beter with images or "more" colors.. some dont work in quartz like xOR

(side note: in future version of DB . dotFont will not be supported anymore, use the proper font ps name, see)