#37454 - 10/06/11 09:01 AM
Re: Variable text colour
[Re: tibenj]
|
Eric Lachance
Unregistered
|
Ben,
There's no way to do it according to the image itself (as in, there's no "automatic color picker"). There may be a workaround, though it requires a bit of work.
First, store the contents of the text you want to display inside a variable. Let's call it @MyText@. The text itself can call other variables using @myvar@ and database fields using [fieldname].
Then, create the text object where you want that text to appear, and type in a series of variables, one for each color you want ot display, for example @ShowTextBlue@@ShowTextPink@
You then need to apply a certain logic within each variable that will make all the text appear, or nothing at all. So, if the image is displayed depending on a client's sex for example, you'd do this for @ShowTextBlue@: IF([Sex] = "M", @MyText@, "") and for @ShowTextPink@: IF([Sex] = "F", @MyText@, "")
And finally, you just select each variable and choose a color for it, e.g. putting @ShowTextBlue@ in blue.
It's not the most elegant solution, but it should work for your purposes.
|
Top
|
|
|
|
#37463 - 10/06/11 05:54 PM
Re: Variable text colour
[Re: ]
|
OL Newbie
Registered: 08/15/11
Posts: 5
|
Thanks a lot Eric,
Yes that should work I will try that right now.
In my case the variable images are depending on a record ID number in my database. It will be easy to do the logic formula then.
I have to say that I needed a fresh eye on that one!
|
Top
|
|
|
|
#37483 - 10/12/11 07:45 AM
Re: Variable text colour
[Re: tibenj]
|
Tyran van Zyl
Unregistered
|
If it were me, depending on your rule to select a dark or light background, I would have 2 layouts with only one of them printing per record, using that variables to chose either the light one or dark one.
Then each layout can have its own text colour
|
Top
|
|
|
|
#37542 - 10/18/11 01:52 AM
Re: Variable text colour
[Re: ]
|
OL Newbie
Registered: 08/15/11
Posts: 5
|
The first option works pretty well at the moment, but I have an other question related:
Here's what I use for one colour: I call the expression below "RED" and I apply the red colour on it. The colour change is related to the subscriberID. My text with the colour change is @TextColour@.
IF([SubscriberID] = "01138", @TextColour@, "") & IF([SubscriberID] = "01156", @TextColour@, "") & IF([SubscriberID] = "01032", @TextColour@, "")
Knowing that I can have more than 3 different SubscriberID for one colour, is there a way not to repeat the "IF" for each SubscriberID? I would like to have a formula saying: IF subscriberID = 01138 or 01156 or 01032 or...
It would help me especially to do the "average colour" (white) which is the one used by the majority of the records. I could have a formula saying that every ID which are not equal to the one I used in the different colour variations would be in white.
Thanks
|
Top
|
|
|
|
#37543 - 10/18/11 03:57 AM
Re: Variable text colour
[Re: tibenj]
|
OL Expert
Registered: 06/10/08
Posts: 207
Loc: Objectif Lune NL
|
How about: IF (CONTAINS("01138 01156 01032", [SubscriberID]), @TextColour@, "")
|
Top
|
|
|
|
#37549 - 10/18/11 07:29 PM
Re: Variable text colour
[Re: Sander vd Berg]
|
OL Newbie
Registered: 08/15/11
Posts: 5
|
Thanks for your answer, it's working! I just had to swap SubscriberID and the text to find though:
IF(CONTAINS([SubscriberID],"01138 01156 01032"), @TextColour@, "")
Great forum, thanks guys.
|
Top
|
|
|
|
|
|