|
Triggers reacting to colors only
|
Reply to this subject
Start a new subject
 
Refresh page
| Posted by |
Vercalos
(23 posts) bio
|
| Date |
Sun 11 Dec 2011 08:10 AM (UTC) [ quote
] |
| Message |
I'm trying to make a trigger so that I can take anything that is
<black foreground> <black background>
into
<custom color foreground> <black background>
without changing the entire line, just the bits where the foreground color and background color are identical. So far, I can make it change the entire line, or none of it, but solely the black on black parts.
This one doesn't work at all
<triggers>
<trigger
back_colour="8"
custom_colour="17"
enabled="y"
keep_evaluating="y"
match=".*?"
match_back_colour="y"
match_bold="y"
match_text_colour="y"
regexp="y"
sequence="100"
text_colour="8"
other_text_colour="dimgray"
>
</trigger>
</triggers>
and this one changes the entire line
<triggers>
<trigger
back_colour="8"
custom_colour="17"
enabled="y"
keep_evaluating="y"
match=".*"
match_back_colour="y"
match_bold="y"
match_text_colour="y"
regexp="y"
sequence="100"
text_colour="8"
other_text_colour="dimgray"
>
</trigger>
</triggers>
| top |
|
| Posted by |
Nick Gammon
Australia (18,800 posts) bio
Forum Administrator |
| Date |
Reply #1 on Sun 11 Dec 2011 07:42 PM (UTC) [ quote
] |
| Message |
The first one doesn't work because the test for the colour is done second. That is, it tests for a match first, and then sees if the colour also matches (in other words it scans for text, not colours).
Thus it matches the very start of the line, and if that is not black-on-black it won't pass the colour test.
Does this (rather bizarre) problem of black-on-black occur on any line? Or just some lines like chats? If we could narrow down the line type we could make a trigger that matched that type of line, and then omitted it, and replaced it with a line where you checked each style run, and if it is black-on-black replaced the black text with something else. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
| Posted by |
Vercalos
(23 posts) bio
|
| Date |
Reply #2 on Sun 11 Dec 2011 07:58 PM (UTC) [ quote
] |
| Message |
| It mostly happens when some wag decides to deliberately use ANSI tags to put black on black. I managed a work-around for people who put black as the foreground without setting a background, but if someone decides to put black on black, I won't be able to read it. | top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
686 views.
Reply to this subject
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )