dequelabs / dequelabs/axe-core

Color-contrast does not take into account mix-blend-mode

Open
#3,187 1 comment 0 reactions 1 assignee Claimed by @Zidious View on GitHub
color contrast
Dominant language
JavaScript
Stars
7.5k
Forks
933
Avg merge
2d 23h
Merged PRs (30d)
17

Description

The [mix-blend-mode CSS property](https://developer.mozilla.org/en-US/docs/Web/CSS/blend-mode) specifies how colors are blended together. By default the `mix-blend-mode` is set to `normal`, which is mostly how our `flattenColor` algorithm works. But by changing the mix-blend-mode the background color can be completely different.

For example, taking this HTML, the output is faint green color.

```html


Hello World


```

![image](https://user-images.githubusercontent.com/2433219/136101592-f586b612-881b-469f-9de9-33fd10eb03a7.png)

But if we change the blend mode we get a completely different color, in this case a faint pink color.

```html


Hello World


```

![image](https://user-images.githubusercontent.com/2433219/136101850-1682d32f-7385-48e3-ada6-e3614b32e921.png)

See https://www.w3.org/TR/compositing-1/#blending

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.