Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Control font color with variable in global script?

4 years ago

Is this possible to do? So far the only way I've been able to use a variable to control font color is with on page scripting, which requires you to do it on every single paragraph. Surely there is a much more efficient way to do this.

Perhaps something in the global script like (using pseudo-script here): "IF FONTCOLOR = 1 THEN PAGETEXT = [span style="color: #ffffff;"]" +PAGETEXT

So can this be done, and if so, how would you go about doing this? I've tried using the pseudo-script above and several variants, but it obviously won't validate.

Thanks for all insight.

Control font color with variable in global script?

4 years ago
I use this in one of my global scripts:

$PAGETEXT := $PAGETEXT + "<STYLE> body {background-color: #FAEBD7; }
p {
text-indent: 50px;
} </STYLE>"


Feel free to adjust and use as desired (such as putting that in a conditional statement).

Control font color with variable in global script?

4 years ago
Thanks but I am trying to do just font color, not background color. If I replace "background-color" with font color do you think that might work? (won't be able to test for about twenty minutes)

And actually, now that I think about it, I could get by without it being for the GLOBAL script, but instead just one time for each page in the page script (rather than every paragraph). Actually, if there is a way to do both, that would be awesome.

Control font color with variable in global script?

4 years ago
$PAGETEXT := "{font color = #ff0000}" + $PAGETEXT + "{/font}"


I'm sure someone will be along to yell that This Is Not The Way It's Done, but it still works. I never was able to memorize the style tag stuff and haven't really needed to. Just combine that with IF and a variable to toggle different colors, unless I'm misunderstanding the question.

Control font color with variable in global script?

4 years ago
Thanks. I'm surprised that works. Anyway, I actually found a way just now for global variable based font color modifying Ogre’s background color script, and with a variable in front it works fine. Might try what you’ve done too.

Oh, the format stuff he has in there isn't necessary for the color, obviously.

Control font color with variable in global script?

4 years ago

Ummm, ACTUALLY, the HTML5-sanctioned method of doing this is <span style="color: #ff0000;"></span> and the font tag will literally trigger your poor browser's PTHTML4D.

Control font color with variable in global script?

4 years ago
I can't believe you took the time to *irkedly mutter to yourself* when it would LITERALLY never be seen unless an admin hit the edit button. ...I'm gonna restrain the urge to go combing through your post history now. Now if you'll excuse me, I need to hurry and update Netscape before my mom needs to use the phone and disconnects me from the internet again.

Control font color with variable in global script?

4 years ago

Oh crap, uh, just imagine a lot of negligible, strategically-placed "display: none"s.

Control font color with variable in global script?

4 years ago
You could always just leave it but camouflage it. For example, you could talk all kinds of shit to mods and filthy peasants with a judicious choice of font color. Why would anyone ever look? The possibilities are endless...

Control font color with variable in global script?

4 years ago
That one shows up faintly even without highlighting

Control font color with variable in global script?

4 years ago
Well I'm sure with some practice one can perfect it. So long as the browser has default settings. But having a bit of a hint is part of the fun.

Control font color with variable in global script?

4 years ago
I used to have the exact color for the forum background in my notepad because that's how everyone did invisible text.

Not as useful now however with the extension around because you don't know how many people are using dark mode.