Search in sources :

Example 1 with BlendMode

use of javafx.scene.effect.BlendMode in project processing by processing.

the class PGraphicsFX2D method blendModeImpl.

//////////////////////////////////////////////////////////////
// BLEND
@Override
protected void blendModeImpl() {
    BlendMode mode = BlendMode.SRC_OVER;
    switch(blendMode) {
        case REPLACE:
            showWarning("blendMode(REPLACE) is not supported");
            break;
        // this is SRC_OVER, the default
        case BLEND:
            break;
        // everyone's favorite
        case ADD:
            mode = BlendMode.ADD;
            break;
        case SUBTRACT:
            showWarning("blendMode(SUBTRACT) is not supported");
            break;
        case LIGHTEST:
            mode = BlendMode.LIGHTEN;
            break;
        case DARKEST:
            mode = BlendMode.DARKEN;
            break;
        case DIFFERENCE:
            mode = BlendMode.DIFFERENCE;
            break;
        case EXCLUSION:
            mode = BlendMode.EXCLUSION;
            break;
        case MULTIPLY:
            mode = BlendMode.MULTIPLY;
            break;
        case SCREEN:
            mode = BlendMode.SCREEN;
            break;
        case OVERLAY:
            mode = BlendMode.OVERLAY;
            break;
        case HARD_LIGHT:
            mode = BlendMode.HARD_LIGHT;
            break;
        case SOFT_LIGHT:
            mode = BlendMode.SOFT_LIGHT;
            break;
        case DODGE:
            mode = BlendMode.COLOR_DODGE;
            break;
        case BURN:
            mode = BlendMode.COLOR_BURN;
            break;
    }
    context.setGlobalBlendMode(mode);
}
Also used : BlendMode(javafx.scene.effect.BlendMode)

Aggregations

BlendMode (javafx.scene.effect.BlendMode)1