enyancc / vscode-ext-color-highlight

Extension adds colored border around css/web colors in the editor
GNU General Public License v3.0
262 stars 83 forks source link

Text is almost invisible when using RGBA (in dark theme) #202

Open Alyaqdhans opened 7 months ago

Alyaqdhans commented 7 months ago

As the title says the text is unreadable when the color is very transparent: image

The text should be aware of the alpha channel in the RGB colors, if it's very transparent the text should be white.

jasikpark commented 6 months ago

Same problem for me using oklch:

image

It seems to only use black text regardless of the contrast ratio against the color?

silverwind commented 5 months ago

Here are some example values with bad contrast. Basically all low-opacity colors are affected.

  --color-markup-table-row: #e8f3ff0f;
  --color-markup-code-block: #e8f3ff12;
  --color-markup-code-inline: #e8f3ff28;
image

Also I wonder why it renders two background rectangles, which may be a separate bug.