Copiar vínculo al Portapapeles
Copiado
Hi Friends,
I need to create new tint swatch.
var myColor = app.activeDocument.swatches.itemByName("COLOR2");
I checked this properties. But, 'New Tint Swatch' option not there. Pls suggest friends how to create "new tint swatch". i need to change tint value.
Thanks
KS
...var main = function(colorName, colorValues, colorTint) {
var doc = app.properties.activeDocument,
baseClr, tintClr, tintClrName, tintClrValue;
if ( !doc ) return;
if (!( typeof ( colorName )== 'string' && colorName!='' ) ) {
alert( "Invalid color name parameter" );
return;
}
if (!colorTint || isNaN(colorTint) || colorTint<1 || colorTint>100 ) {
alert( "Invalid colorTint parameter" );
return;
}
baseClr = doc.swatches.itemByName ( colorName );
if ( !baseClr.isValid ) {
baseClr = doc.colors.add({
colorValue:col
Copiar vínculo al Portapapeles
Copiado
var main = function(colorName, colorValues, colorTint) {
var doc = app.properties.activeDocument,
baseClr, tintClr, tintClrName, tintClrValue;
if ( !doc ) return;
if (!( typeof ( colorName )== 'string' && colorName!='' ) ) {
alert( "Invalid color name parameter" );
return;
}
if (!colorTint || isNaN(colorTint) || colorTint<1 || colorTint>100 ) {
alert( "Invalid colorTint parameter" );
return;
}
baseClr = doc.swatches.itemByName ( colorName );
if ( !baseClr.isValid ) {
baseClr = doc.colors.add({
colorValue:colorValues,
model:ColorModel.PROCESS,
name:colorName,
space:ColorSpace.CMYK
});
}
tintClrValue = /%/.test( colorTint )? String(colorTint).replace(/%/, "g" ) : colorTint;
tintClrValue = Number ( tintClrValue );
tintClrName = colorName +" "+tintClrValue+"%";
tintClr = doc.swatches.itemByName ( tintClrName );
if ( !tintClr.isValid ) {
tintClr = doc.tints.add(baseClr, {
tintValue:tintClrValue,
});
}
}
var u;
app.doScript ( "main('blue', [100,30,0,0], 80)",u,u,UndoModes.ENTIRE_SCRIPT, "The Script" );
HTH
Loic Aigon
Encuentra más inspiración, eventos y recursos en la nueva comunidad de Adobe
Explorar ahora