• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to make a fix color template for words / font

New Here ,
Oct 08, 2019 Oct 08, 2019

Copy link to clipboard

Copied

Hi,

i know how to change color in every letter, but if i want to make  longer words i need to change every letter collor one by one, is there any way to automatically or some way with blending option so i dont need to change every letter color one by one?

 

nb: sry for my bad english, i attach image below for better explanation 

 

123123213.PNG

 

Views

864

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Oct 09, 2019 Oct 09, 2019

Copy link to clipboard

Copied

One way I can think of is to create stripped colored image on separate layer then to clip it to text below. This is much easier to do on line by line basis, so it is recommended to use point instead of paragraph text. Another way is to create pattern, save it then apply as Pattern Overlay layer effect.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 09, 2019 Oct 09, 2019

Copy link to clipboard

Copied

thank you!! using clip mask is great way to make colorful text with less effort, but i dont get it with pattern overlay effect, i manage to create a pattern with stripped colored image, then apply using fill pattern overlay, but it show nothing?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 09, 2019 Oct 09, 2019

Copy link to clipboard

Copied

Hi
Pattern overlay works here. You may need to click snap to origin, or scale and drag it on the canvas, to position it.

2019-10-09_12-15-23.jpg

Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 09, 2019 Oct 09, 2019

Copy link to clipboard

Copied

Dave, can you try that when the text is on multiple lines and when it changes type size to see if it still works? The OP’s pattern is 10 colors that repeat, skipping spaces.

 

~Jane

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 09, 2019 Oct 09, 2019

Copy link to clipboard

Copied

How successful depends on the type Jane. All it really does is add an overlay to the layer. So if the letter width is even and each line is on a separate layer it can adjusted quickly. If the layer width is uneven it would be quicker to paint on a clipped layer.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 09, 2019 Oct 09, 2019

Copy link to clipboard

Copied

I think anything more variable and automatic would need the scripting experts to take a look.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 09, 2019 Oct 09, 2019

Copy link to clipboard

Copied

It could fall apart, imho, Dave.

 

The OP has upper and lower case and an "i" is skinnier that an "o" with proportional type. You could make it work, I think, but I also think it would take less time and would be more stable to use another method. Here's what I got. 🙂 It's an example of how wrong it could go.

 

~ Jane

 

clipboard_image_0.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 09, 2019 Oct 09, 2019

Copy link to clipboard

Copied

Doing this with scripting would be a solution, but very involved. See this link for an example along the same lines: https://community.adobe.com/t5/Photoshop/Changing-color-of-text-found-with-regex/td-p/9320147

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 14, 2019 Oct 14, 2019

Copy link to clipboard

Copied

LATEST
The below code might work, naturally you’s habve to amend the Array »theColors«. 
textColorTest_1.jpg

textColorTest_2.jpg

// apply colors from array to letters of selected type layer;
// 2019, use it at your own risk;
#target photoshop-130.064
if (app.documents.length > 0) {
//////////////////
try {
var theFonts = new Array;
var theStyleRanges = new Array;
// get font of active layer;
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") ); 
var layerDesc = executeActionGet(ref);
var layerSet = typeIDToStringID(layerDesc.getEnumerationValue(stringIDToTypeID("layerSection")));
var isBackground = layerDesc.getBoolean(stringIDToTypeID("background"));
var theName = layerDesc.getString(stringIDToTypeID('name'));
// if not layer group collect values;
if (layerSet != "layerSectionEnd" && layerSet != "layerSectionStart" && isBackground != true) {
var hasText = layerDesc.hasKey(stringIDToTypeID("textKey"));
if (hasText == true) {
var textDesc = layerDesc.getObjectValue(stringIDToTypeID('textKey'));
var theText = textDesc.getString(stringIDToTypeID('textKey'));
var paragraphRangeList = textDesc.getList(stringIDToTypeID('paragraphStyleRange'));
var kernRange = textDesc.getList(stringIDToTypeID('kerningRange'));
var rangeList = textDesc.getList(stringIDToTypeID('textStyleRange'));
// process the list;
for (var o = 0; o < rangeList.count; o++) {
var thisList = rangeList.getObjectValue(o);
var theFrom = thisList.getInteger(stringIDToTypeID('from'));
var theTo = thisList.getInteger(stringIDToTypeID('to'));
var styleDesc = thisList.getObjectValue(stringIDToTypeID('textStyle'));
var aSize = styleDesc.getUnitDoubleValue(charIDToTypeID( "Sz  " ));
// check for default font;
if (styleDesc.hasKey(stringIDToTypeID('fontPostScriptName')) == true) {var aFont = styleDesc.getString(stringIDToTypeID('fontPostScriptName'))}
else {
var theDefault = styleDesc.getObjectValue(stringIDToTypeID('baseParentStyle'));
var aFont = theDefault.getString(stringIDToTypeID('fontPostScriptName'));
};
if (styleDesc.hasKey(stringIDToTypeID('impliedFontSize')) == true) {var aFont = styleDesc.getString(stringIDToTypeID('fontPostScriptName'))}
// add to array;
theFonts.push([aFont, aSize, theFrom, theTo]);
theStyleRanges.push(thisList.getObjectValue(stringIDToTypeID('textStyle')));
}
}
};
// the color array;
var theColors = [[255,0,0], [255,255,0], [0,255,0],[0,255,255], [0,0,255], [255,0,255]];
var anIndex = 0;
var theColorNumber = theColors.length;
// change text;
// =======================================================
var idPxl = charIDToTypeID( "#Pxl" );
var idTxtt = charIDToTypeID( "Txtt" );
var idFrom = charIDToTypeID( "From" );
var idT = charIDToTypeID( "T   " );
var idTxtS = charIDToTypeID( "TxtS" );
var idTxLr = charIDToTypeID( "TxLr" );
var idTxt = charIDToTypeID( "Txt " );
var idsetd = charIDToTypeID( "setd" );
    var desc6 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref1 = new ActionReference();
        ref1.putEnumerated( idTxLr, charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt"  ));
    desc6.putReference( idnull, ref1 );
        var desc7 = new ActionDescriptor();
        desc7.putString( idTxt, theText );
            var list2 = new ActionList();
//////////////////
// define each letter individually;
var theIndex = 0;
var theRef = theStyleRanges[theIndex];
var theRef2 = theFonts[theIndex];
for (var m = 0; m < theText.length; m++) {
// check for relevant style range;
if (m == theRef2[3]) {
theIndex++;
var theRef = theStyleRanges[theIndex];
var theRef2 = theFonts[theIndex];
};
var desc14 = new ActionDescriptor();
desc14.putInteger( idFrom, m );
desc14.putInteger( idT, m+1 );
var theStyle = theRef;
var desc21 = new ActionDescriptor();
desc21.putDouble( charIDToTypeID( "Rd  " ), theColors[anIndex][0] );
desc21.putDouble( charIDToTypeID( "Grn " ), theColors[anIndex][1]  );
desc21.putDouble( charIDToTypeID( "Bl  " ), theColors[anIndex][2]  );
theStyle.putObject( charIDToTypeID( "Clr " ), charIDToTypeID( "RGBC" ), desc21 );
desc14.putObject( stringIDToTypeID('textStyle'), stringIDToTypeID('textStyle'), theStyle);
list2.putObject( charIDToTypeID( "Txtt" ),  desc14);
anIndex++;
if (theText[m].match(/\s/)!=null) {anIndex--};
if (anIndex == theColorNumber) {anIndex = 0};
};
//////////////////
//        desc7.putList( stringIDToTypeID('paragraphStyleRange'), paragraphRangeList );
//        desc7.putList( stringIDToTypeID('kerningRange'), kernRange);
        desc7.putList( idTxtt, list2 );
    desc6.putObject( idT, idTxLr, desc7 );
executeAction( idsetd, desc6, DialogModes.NO );
}
catch (e) {};
};
//////////////////

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines