use bat's --highlight-line feature, but dim rest instead of highlighting selected
example:
# dim and remove colors from unhighlighted lines
bat f.ts -H 42 | ./highlight-dim.ts
# dim colors from unhighlighted lines
bat f.ts -H 42 | ./highlight-dim.ts --keep-colors