Skip to content

Reability returns contrast only for solid colours (WCAG) #87

@ColinLondon

Description

@ColinLondon

Hi All,

The TC readability function returns the contrast ratios of two colours. But even is an alpha colour is passed in the param the ratio returned is only for solid colours.

So passing:

"rgba(0, 102, 161, 0.5)", "fff"

and

"rgb(0, 102, 161)", "fff"

yields the same ratio (6.15).

I come up against designers that use alpha an awful lot, and working out the effective contrast ratio to meet with WCAG is a real pain.

Can TC please be made to support alpha colours? A bit like this one:

https://github.com/LeaVerou/contrast-ratio

If anyone knows how to do this, you will be on my Christmas card list!

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions