Try this code:
on ^*:TEXT:**:?,#:{
var %s, %r = /\030? $+ $color(background) $+ (?!,\d{0,2}) $+ /g
%r = $regsub(,$1-,%r,,%s)
if (!$window($target)) query $target
echo -tl $target < $+ $nick $+ > %s
haltdef
}
It should remove any color codes that have a foreground color that is the same as your background color, unless there is a background color included with the color code.
Example:
(assuming you background color is white - 0)
([] = ctrl+k)
[]0TEXT = color code removed
[]00TEXT = color code removed
[]00,01TEXT = color code not removed
[]00,00TEXT = color code not removed
[]12TEXT = color code not removed
[]12,00TEXT = color code not removed
[]12,15TEXT = color code not removed
-genius_at_work