UXP Toolkit
    Preparing search index...

    An object literal can be constructed with the following properties and passed to Document.calculations. As a type, CalculationsOptions can be used in Typescript development.

    const options = {
    source1: {
    document: doc,
    layer: doc.layers[0],
    channel: CalculationsChannel.GRAY
    invert: true
    },
    source2: {
    document: doc,
    layer: CalculationsLayer.MERGED,
    channel: doc.channels[2]
    },
    blending: CalculationsBlendMode.DARKEN,
    opacity: 50,
    result: CalculationsResult.NEWCHANNEL
    };
    await require('photoshop').app.activeDocument.calculations(options);

    objects/options

    24.5

    interface CalculationsOptions {
        blending?: CalculationsBlendMode;
        mask?: CalculationsSource;
        opacity?: number;
        result: CalculationsResult;
        source1: CalculationsSource;
        source2: CalculationsSource;
    }
    Index

    Properties

    The blend mode used to merge "Source 1" and "Source 2" together. "Source 1" will be rendered above "Source 2"

    MULTIPLY
    

    24.5

    The Mask reference to be used in the Calculations operation

    24.5

    opacity?: number

    The opacity used for "Source 1" when merged with "Source 2".

    0..100

    100
    

    24.5

    Where to output the result of the Calculations operation

    24.5

    The "Source 1" reference to be used in the Calculations operation. "Source 1" will be rendered above "Source 2"

    24.5

    The "Source 2" reference to be used in the Calculations operation

    24.5