Photoshop Scripting:Hue Shifting

时间:2016-12-28 06:16:59

标签: javascript photoshop-script

我需要编写一个脚本来调整photoshop中的色调。 我需要的是移动前景色的色调并改变其黑暗并将此功能分配给击键。 有可能吗?

1 个答案:

答案 0 :(得分:0)

您可以使用Hue Saturation Lightness shift:

function colourhsl(localRange, beginRamp, beginSustain, endSustain, endRamp, hue, sat, lum)
{
    var id25432 = charIDToTypeID( "HStr" );
    var desc1114 = new ActionDescriptor();
    var id25433 = charIDToTypeID( "Clrz" );
    desc1114.putBoolean( id25433, false );
    var id25434 = charIDToTypeID( "Adjs" );
    var list89 = new ActionList();
    var desc1115 = new ActionDescriptor();

    var id25435 = charIDToTypeID( "LclR" ); //local range
    desc1115.putInteger( id25435, localRange );
    var id25436 = charIDToTypeID( "BgnR" ); //begin ramp
    desc1115.putInteger( id25436, beginRamp );
    var id25437 = charIDToTypeID( "BgnS" ); //begin sustain
    desc1115.putInteger( id25437, beginSustain );
    var id25438 = charIDToTypeID( "EndS" ); //end sustain
    desc1115.putInteger( id25438, endSustain);
    var id25439 = charIDToTypeID( "EndR" ); //end ramp
    desc1115.putInteger( id25439, endRamp );

    //hue
    var id25440 = charIDToTypeID( "H   " );
    desc1115.putInteger( id25440, hue );

    //saturation
    var id25441 = charIDToTypeID( "Strt" );
    desc1115.putInteger( id25441, sat );

    //light
    var id25442 = charIDToTypeID( "Lght" );
    desc1115.putInteger( id25442, lum );

    var id25443 = charIDToTypeID( "Hst2" );
    list89.putObject( id25443, desc1115 );
    desc1114.putList( id25434, list89 );
    executeAction( id25432, desc1114, DialogModes.NO );
}

// example (localRange, beginRamp, beginSustain, endSustain, endRamp, hue, sat, lum)
//colourhsl(3,75,105,135,165,0,-100,0);