[Help] Forcing a text color

General questions about scripts and buttons should be asked here. Development scripts and buttons may also be posted for feedback.

Moderators: Support Staff², Support Staff, Developer, AvantGuard

Joe4evr
Newbie
Newbie
Posts: 1
Joined: Tue Mar 16, 2010 6:32 pm
Windows Version: Windows 7
Avant Version: 11.7 b46
IE Version: 8

[Help] Forcing a text color

Postby Joe4evr » Tue Mar 16, 2010 6:54 pm

Hi, I've been using Avant Browser for years now, but there's a little thing that's irking me as of late. Sometimes in Gmail I get a message in which text was forced to black or another dark color, but since I'm using the Terminal theme it doesn't show on a black background, so I was wondering if it's possible to write a script that automatically forces this to the default text color.

Unfortunately, I know next to nothing about JavaScript, so I had to look up quite a lot. I've found this code snippet which may be useful, and I wrote what (I hope) will replace the color.

Code: Select all

var x;
var col = getElementsByAttribute(color);
//removes the "#" and turns the value of col into an integer
Number(col.replace("#",""));

for(x in col)
{
   //conditions
   if((col[x] <= 202020 && col[x] >= 202000) || (col[x] <=  200020 && col[x] >= 200000) || (col[x] <=  002020 && col[x] >= 002000) || (col[x] <= 000020 && col[x] >= 000000))
   {
      col[x]="#00CC00";
   }
}


I'm absolutely not sure how correct this is, so I'm asking here to have someone look this over and correct me where possible.

Thanks in advance.

Return to “Scripts and Buttons Development and Discussions”

Who is online

Users browsing this forum: No registered users

cron