var war_foregroundColor = app.foregroundColor;
var i = 0;
var fw = new Array;
while (app.showColorPicker()) {
fw[i] = app.foregroundColor;
i = i + 1;
}
// highlight = fw[0]; midtone = fw[1]; shadow = fw[2];
// Einstellebene Verlaufsumsetzung
var idMk = charIDToTypeID( "Mk " );
var desc2 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref1 = new ActionReference();
var idAdjL = charIDToTypeID( "AdjL" );
ref1.putClass( idAdjL );
desc2.putReference( idnull, ref1 );
var idUsng = charIDToTypeID( "Usng" );
var desc3 = new ActionDescriptor();
var idType = charIDToTypeID( "Type" );
var desc4 = new ActionDescriptor();
var idGrad = charIDToTypeID( "Grad" );
var desc5 = new ActionDescriptor();
var idNm = charIDToTypeID( "Nm " );
desc5.putString( idNm, """Vorder- zu Hintergrundfarbe""" );
var idGrdF = charIDToTypeID( "GrdF" );
var idGrdF = charIDToTypeID( "GrdF" );
var idCstS = charIDToTypeID( "CstS" );
desc5.putEnumerated( idGrdF, idGrdF, idCstS );
var idIntr = charIDToTypeID( "Intr" );
desc5.putDouble( idIntr, 4096.000000 );
var idClrs = charIDToTypeID( "Clrs" );
var list1 = new ActionList();
var desc6 = new ActionDescriptor();
var idClr = charIDToTypeID( "Clr " );
var desc7 = new ActionDescriptor();
var idRd = charIDToTypeID( "Rd " );
desc7.putDouble( idRd, 7.000000 );
var idGrn = charIDToTypeID( "Grn " );
desc7.putDouble( idGrn, 3.000000 );
var idBl = charIDToTypeID( "Bl " );
desc7.putDouble( idBl, 3.000000 );
var idRGBC = charIDToTypeID( "RGBC" );
desc6.putObject( idClr, idRGBC, desc7 );
var idType = charIDToTypeID( "Type" );
var idClry = charIDToTypeID( "Clry" );
var idUsrS = charIDToTypeID( "UsrS" );
desc6.putEnumerated( idType, idClry, idUsrS );
var idLctn = charIDToTypeID( "Lctn" );
desc6.putInteger( idLctn, 0 );
var idMdpn = charIDToTypeID( "Mdpn" );
desc6.putInteger( idMdpn, 50 );
var idClrt = charIDToTypeID( "Clrt" );
list1.putObject( idClrt, desc6 );
var desc8 = new ActionDescriptor();
var idClr = charIDToTypeID( "Clr " );
var desc9 = new ActionDescriptor();
var idRd = charIDToTypeID( "Rd " );
desc9.putDouble( idRd, 252.000000 );
var idGrn = charIDToTypeID( "Grn " );
desc9.putDouble( idGrn, 250.000000 );
var idBl = charIDToTypeID( "Bl " );
desc9.putDouble( idBl, 248.000000 );
var idRGBC = charIDToTypeID( "RGBC" );
desc8.putObject( idClr, idRGBC, desc9 );
var idType = charIDToTypeID( "Type" );
var idClry = charIDToTypeID( "Clry" );
var idUsrS = charIDToTypeID( "UsrS" );
desc8.putEnumerated( idType, idClry, idUsrS );
var idLctn = charIDToTypeID( "Lctn" );
desc8.putInteger( idLctn, 4096 );
var idMdpn = charIDToTypeID( "Mdpn" );
desc8.putInteger( idMdpn, 50 );
var idClrt = charIDToTypeID( "Clrt" );
list1.putObject( idClrt, desc8 );
// *** Shadow setzen
var desc81 = new ActionDescriptor();
var idClr = charIDToTypeID( "Clr " );
var desc91 = new ActionDescriptor();
var idRd = charIDToTypeID( "Rd " ); // <-- 3 x Farben
desc91.putDouble( idRd, fw[2].rgb.red );
var idGrn = charIDToTypeID( "Grn " );
desc91.putDouble( idGrn, fw[2].rgb.green );
var idBl = charIDToTypeID( "Bl " );
desc91.putDouble( idBl, fw[2].rgb.blue );
var idRGBC = charIDToTypeID( "RGBC" );
desc81.putObject( idClr, idRGBC, desc91 );
var idType = charIDToTypeID( "Type" );
var idClry = charIDToTypeID( "Clry" );
var idUsrS = charIDToTypeID( "UsrS" );
desc81.putEnumerated( idType, idClry, idUsrS );
var idLctn = charIDToTypeID( "Lctn" );
desc81.putInteger( idLctn, fw[2].hsb.brightness * 4096 / 100 ); // <-- Location
var idMdpn = charIDToTypeID( "Mdpn" );
desc81.putInteger( idMdpn, 50 );
var idClrt = charIDToTypeID( "Clrt" );
list1.putObject( idClrt, desc81 );
// *** Midtone setzen
var desc82 = new ActionDescriptor();
var idClr = charIDToTypeID( "Clr " );
var desc92 = new ActionDescriptor();
var idRd = charIDToTypeID( "Rd " ); // 3 x <-- Farben
desc92.putDouble( idRd, fw[1].rgb.red );
var idGrn = charIDToTypeID( "Grn " );
desc92.putDouble( idGrn, fw[1].rgb.green );
var idBl = charIDToTypeID( "Bl " );
desc92.putDouble( idBl, fw[1].rgb.blue );
var idRGBC = charIDToTypeID( "RGBC" );
desc82.putObject( idClr, idRGBC, desc92 );
var idType = charIDToTypeID( "Type" );
var idClry = charIDToTypeID( "Clry" );
var idUsrS = charIDToTypeID( "UsrS" );
desc82.putEnumerated( idType, idClry, idUsrS );
var idLctn = charIDToTypeID( "Lctn" );
desc82.putInteger( idLctn, fw[1].hsb.brightness * 4096 / 100 ); //
var idMdpn = charIDToTypeID( "Mdpn" );
desc82.putInteger( idMdpn, 50 );
var idClrt = charIDToTypeID( "Clrt" );
list1.putObject( idClrt, desc82 );
// *** Highlight setzen
var desc83 = new ActionDescriptor();
var idClr = charIDToTypeID( "Clr " );
var desc93 = new ActionDescriptor();
var idRd = charIDToTypeID( "Rd " ); // <-- 3 x Farben
desc93.putDouble( idRd, fw[0].rgb.red );
var idGrn = charIDToTypeID( "Grn " );
desc93.putDouble( idGrn, fw[0].rgb.green );
var idBl = charIDToTypeID( "Bl " );
desc93.putDouble( idBl, fw[0].rgb.blue );
var idRGBC = charIDToTypeID( "RGBC" );
desc83.putObject( idClr, idRGBC, desc93 );
var idType = charIDToTypeID( "Type" );
var idClry = charIDToTypeID( "Clry" );
var idUsrS = charIDToTypeID( "UsrS" );
desc83.putEnumerated( idType, idClry, idUsrS );
var idLctn = charIDToTypeID( "Lctn" );
desc83.putInteger( idLctn, fw[0].hsb.brightness * 4096 / 100 ); // <-- Location
var idMdpn = charIDToTypeID( "Mdpn" );
desc83.putInteger( idMdpn, 50 );
var idClrt = charIDToTypeID( "Clrt" );
list1.putObject( idClrt, desc83 );
//
desc5.putList( idClrs, list1 );
var idTrns = charIDToTypeID( "Trns" );
var list2 = new ActionList();
var desc10 = new ActionDescriptor();
var idOpct = charIDToTypeID( "Opct" );
var idPrc = charIDToTypeID( "#Prc" );
desc10.putUnitDouble( idOpct, idPrc, 30.000000 );
var idLctn = charIDToTypeID( "Lctn" );
desc10.putInteger( idLctn, 0 );
var idMdpn = charIDToTypeID( "Mdpn" );
desc10.putInteger( idMdpn, 50 );
var idTrnS = charIDToTypeID( "TrnS" );
list2.putObject( idTrnS, desc10 );
var desc11 = new ActionDescriptor();
var idOpct = charIDToTypeID( "Opct" );
var idPrc = charIDToTypeID( "#Prc" );
desc11.putUnitDouble( idOpct, idPrc, 30.000000 );
var idLctn = charIDToTypeID( "Lctn" );
desc11.putInteger( idLctn, 4096 );
var idMdpn = charIDToTypeID( "Mdpn" );
desc11.putInteger( idMdpn, 50 );
var idTrnS = charIDToTypeID( "TrnS" );
list2.putObject( idTrnS, desc11 );
// *** Deckkraft Shadow setzen
var desc111 = new ActionDescriptor();
var idOpct = charIDToTypeID( "Opct" );
var idPrc = charIDToTypeID( "#Prc" );
desc111.putUnitDouble( idOpct, idPrc, 90.000000 );
var idLctn = charIDToTypeID( "Lctn" );
desc111.putInteger( idLctn, fw[2].hsb.brightness * 4096 / 100 ); // <-- Location
var idMdpn = charIDToTypeID( "Mdpn" );
desc111.putInteger( idMdpn, 50 );
var idTrnS = charIDToTypeID( "TrnS" );
list2.putObject( idTrnS, desc111 );
// *** Deckkraft Mitten setzen
var desc112 = new ActionDescriptor();
var idOpct = charIDToTypeID( "Opct" );
var idPrc = charIDToTypeID( "#Prc" );
desc112.putUnitDouble( idOpct, idPrc, 100.000000 );
var idLctn = charIDToTypeID( "Lctn" );
desc112.putInteger( idLctn, fw[1].hsb.brightness * 4096 / 100 ); // <-- Location
var idMdpn = charIDToTypeID( "Mdpn" );
desc112.putInteger( idMdpn, 50 );
var idTrnS = charIDToTypeID( "TrnS" );
list2.putObject( idTrnS, desc112 );
// *** Deckkraft Highlight setzen
var desc113 = new ActionDescriptor();
var idOpct = charIDToTypeID( "Opct" );
var idPrc = charIDToTypeID( "#Prc" );
desc113.putUnitDouble( idOpct, idPrc, 90.000000 );
var idLctn = charIDToTypeID( "Lctn" );
desc113.putInteger( idLctn, fw[0].hsb.brightness * 4096 / 100 ); // <-- Location
var idMdpn = charIDToTypeID( "Mdpn" );
desc113.putInteger( idMdpn, 50 );
var idTrnS = charIDToTypeID( "TrnS" );
list2.putObject( idTrnS, desc113 );
//
desc5.putList( idTrns, list2 );
var idGrdn = charIDToTypeID( "Grdn" );
desc4.putObject( idGrad, idGrdn, desc5 );
var idGdMp = charIDToTypeID( "GdMp" );
desc3.putObject( idType, idGdMp, desc4 );
var idAdjL = charIDToTypeID( "AdjL" );
desc2.putObject( idUsng, idAdjL, desc3 );
executeAction( idMk, desc2, DialogModes.NO );
activeDocument.activeLayer.blendMode = BlendMode.COLORBLEND;
// Einstellebene ist jetzt angelegt
// Vordergrundfarbe wiederherstellen
app.foregroundColor = war_foregroundColor;