On 10 Jan 2018, 3:12 AM +0800, Eli Zaretskii <eliz@gnu.org>, wrote:

If you must set the foreground of the text the same as the background
of the hl-line face, then customize the hl-line face to define the
"distant foreground" color for it. E.g., I defined the "distant
foreground" to be black, and the problem went away. 


Tried with some colors. It didn’t always work well. For example, in the following picture, the left is the test code, the right is the details of the face hl-line, the highlighted one line in the left window is the result.