Implement missing blend modes

This commit is contained in:
JannisX11 2022-08-17 10:35:34 +02:00
parent fec0e78c0c
commit e1e1cd3dd3
2 changed files with 7 additions and 7 deletions

View File

@ -1054,15 +1054,15 @@ const Painter = {
// Todo: Equations for remaining blend modes
case 'screen':
mix[ch] = ((normal_base / normal_added) * added.a) + (normal_base * (1-added.a));
mix[ch] = ((1 - ((1-normal_base) * (1-normal_added))) * added.a) + (normal_base * (1-added.a));
break;
case 'hard_light':
mix[ch] = ((normal_base / normal_added) * added.a) + (normal_base * (1-added.a));
break;
//case 'hard_light':
//mix[ch] = ((normal_base / normal_added) * added.a) + (normal_base * (1-added.a));
//break;
case 'difference':
mix[ch] = ((normal_base - normal_added) * added.a) + (normal_base * (1-added.a));
mix[ch] = ((1-normal_base) * added.a * normal_added) + (normal_base * (1-(added.a*normal_added)));
break;
}
@ -1683,8 +1683,7 @@ BARS.defineActions(function() {
divide: true,
add: true,
subtract: true,
overlay: true,
hard_light: true,
screen: true,
difference: true,
}
})

View File

@ -901,6 +901,7 @@
"action.blend_mode.divide": "Divide",
"action.blend_mode.add": "Add",
"action.blend_mode.subtract": "Subtract",
"action.blend_mode.screen": "Screen",
"action.blend_mode.overlay": "Overlay",
"action.blend_mode.hard_light": "Hard Light",
"action.blend_mode.difference": "Difference",