Jump to content

Text Color from Data Field


draco66

Recommended Posts

Asking for help twice in two days. Sorry about that.

 

I have searched for this and nothing seems to fit what I am looking for.

 

Sounds simple but I can't figure out how to do it.

 

I have a data field that will contain a color.

In my text frame I want the color of the text to match what the color in the data field is.

 

So if the color in the data is "Blue" then all the text that prints in that text box in my template should be Blue.

Link to comment
Share on other sites

You just need a rule that returns the color tag at the beginning of your text box. The following rule will return the color tag if the color in the "Color" field is a defined FusionPro color:

var color = Field("Color");
return FusionPro.Colors[ToLower(color)] ? '<color name="' + color + '">' : '';

Link to comment
Share on other sites

Does not work.

 

So I created a rule with the code you provided. Clicked the return as tagged text box in the create rule screen.

 

In the variable text editor window I inserted the rule as the first item in the window.

 

All text is still black even though the rule validates to Green.

 

Am I putting it in the correct window?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...