Hadrian Posted July 20, 2011 Share Posted July 20, 2011 Is there a way to create and apply a text frame color that is not in the color library? For example, dynamically create C=43 M=43 Y=0 K=0 based on a text field entry or say an image file that is named "043-043-000-000.jpg". I know i would need to use something similar to the code below but that is referencing a color in the library. Is there a color value tag i can use? theBox = FindTextFrame("box"); theBox.fillColorName = "Red" Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted July 26, 2011 Share Posted July 26, 2011 No, you can only use a named color with the text frame properties. However, you can use a "solid block" character, copyfitted to fill another frame behind your frame, with a tag to specify any arbitrary color, with a rule such as this: return '<color cmyk=77777777><f name="Arial Unicode MS"><unicode>2588</unicode></f></color>'; Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted November 6, 2012 Share Posted November 6, 2012 No, you can only use a named color with the text frame properties. This is no longer true. With FusionPro 8.1 or later, you can call “new FusionProColor” to create a color. The signature is: new FusionProColor(name [,cyan] [,magenta] [,yellow] [,black] [,isSpot]) Where the CYMK values are percentages. You can find this in the Building Blocks dialog, on the Objects tab, under the “Resources” node. An example is: var myColor = new FusionProColor("Brown", 0, 3, 5, 62); FindTextFrame("Title").fillColorName = "Brown";Of course, the values can come from data fields, like so: var myColor = new FusionProColor("User Color", Int(Field("Cyan"), Int(Field("Yellow"), Int(Field("Magenta"), Int(Field("Black")); FindTextFrame("Title").fillColorName = "User Color"; Quote Link to comment Share on other sites More sharing options...
Hadrian Posted November 7, 2012 Author Share Posted November 7, 2012 Thanks for the update Dan. Quote Link to comment Share on other sites More sharing options...
andym Posted March 1, 2013 Share Posted March 1, 2013 I have been looking for a solution to add a custom color to the drop down for frame colors. Attached is an image to be clear where I am talking about. Is this thread giving the solution? If so, where do I enter the code listed? Thank you, Andy Quote Link to comment Share on other sites More sharing options...
dreimer Posted March 1, 2013 Share Posted March 1, 2013 You can create colors in the advanced under the Fusion Pro menu. It will then show up in your dropdown. Quote Link to comment Share on other sites More sharing options...
andym Posted March 1, 2013 Share Posted March 1, 2013 Too easy...thank you for not laughing me off of the forum! Andy Quote Link to comment Share on other sites More sharing options...
dreimer Posted March 1, 2013 Share Posted March 1, 2013 No worries, we all are beginners at one point. Quote Link to comment Share on other sites More sharing options...
dmp Posted January 7, 2014 Share Posted January 7, 2014 Hi there, speaking of beginners I'm trying to do this with a pantone chart data I have in tab.txt format. I tried this code: var myColor = new FusionProColor("isSpot", Int(Field("C")), Int(Field("M")), Int(Field("Y")), Int(Field("K"))); FindTextFrame("Box").fillColorName = "isSpot"; And it says It's not returning a value. I really am stumbling through here so please forgive me if I missed something ridiculously simple. I created a text frame and called it Box. Then I tried to create a new rule with that code above. My data file is just: [Name] [C] [M] [Y] [K] with the corresponding cmyk values in each column. My goal is to basically fill the box with that color. About 2800 or so colors and then impose it so I can make a color chart. Anyone have an idea as to what I'm doing wrong? (or at least a solution to this problem) Thanks for the help! -Mike Quote Link to comment Share on other sites More sharing options...
step Posted January 7, 2014 Share Posted January 7, 2014 Are you using FP 8.1 or later? If not, that won't work. If you are, make sure that the frame you want to fill the color with is called "Box" and make sure that you have that code in an OnRecordStart Callback rule. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 7, 2014 Share Posted January 7, 2014 I tried this code: var myColor = new FusionProColor("isSpot", Int(Field("C")), Int(Field("M")), Int(Field("Y")), Int(Field("K"))); FindTextFrame("Box").fillColorName = "isSpot"; And it says It's not returning a value. You need to put the code in the OnRecordStart callback rule, not in a regular rule. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.