packages/utils/src/color/premultiply.js
function mapPremultipliedBlendModes()
{
    const pm = [];
    const npm = [];

    for (let i = 0; i < 32; i++)
    {
        pm[i] = i;
        npm[i] = i;
    }

    pm[BLEND_MODES.NORMAL_NPM] = BLEND_MODES.NORMAL;
    pm[BLEND_MODES.ADD_NPM] = BLEND_MODES.ADD;
    pm[BLEND_MODES.SCREEN_NPM] = BLEND_MODES.SCREEN;

    npm[BLEND_MODES.NORMAL] = BLEND_MODES.NORMAL_NPM;
    npm[BLEND_MODES.ADD] = BLEND_MODES.ADD_NPM;
    npm[BLEND_MODES.SCREEN] = BLEND_MODES.SCREEN_NPM;

    const array = [];

    array.push(npm);
    array.push(pm);

    return array;
}
function mapPremultipliedBlendModes()
{
    const pm = [];
    const npm = [];

    for (let i = 0; i < 32; i++)
    {
        pm[i] = i;
        npm[i] = i;
    }

    pm[BLEND_MODES.NORMAL_NPM] = BLEND_MODES.NORMAL;
    pm[BLEND_MODES.ADD_NPM] = BLEND_MODES.ADD;
    pm[BLEND_MODES.SCREEN_NPM] = BLEND_MODES.SCREEN;

    npm[BLEND_MODES.NORMAL] = BLEND_MODES.NORMAL_NPM;
    npm[BLEND_MODES.ADD] = BLEND_MODES.ADD_NPM;
    npm[BLEND_MODES.SCREEN] = BLEND_MODES.SCREEN_NPM;

    const array = [];

    array.push(npm);
    array.push(pm);

    return array;
}
function mapPremultipliedBlendModes ( ) { const pm = [ ] ; const npm = [ ] ; for ( let i = 0 ; i < 32 ; i ++ ) { pm [ i ] = i ; npm [ i ] = i ; } pm [ BLEND_MODES . NORMAL_NPM ] = BLEND_MODES . NORMAL ; pm [ BLEND_MODES . ADD_NPM ] = BLEND_MODES . ADD ; pm [ BLEND_MODES . SCREEN_NPM ] = BLEND_MODES . SCREEN ; npm [ BLEND_MODES . NORMAL ] = BLEND_MODES . NORMAL_NPM ; npm [ BLEND_MODES . ADD ] = BLEND_MODES . ADD_NPM ; npm [ BLEND_MODES . SCREEN ] = BLEND_MODES . SCREEN_NPM ; const array = [ ] ; array . push ( npm ) ; array . push ( pm ) ; return array ; }
Corrects PixiJS blend, takes premultiplied alpha into account

@memberof PIXI.utils
@function mapPremultipliedBlendModes
@private
@param {Array<number[]>} [array] - The array to output into.
@return {Array<number[]>} Mapped modes.
Corrects PixiJS blend takes premultiplied alpha into account