Skip to content

Show contrast for color combinations #17

@TowardsDeath

Description

@TowardsDeath

According to the WCAG2 standards:

http://www.w3.org/TR/WCAG20/#contrast-ratiodef

var lum1 = this.luminosity();
var lum2 = color2.luminosity();
if (lum1 > lum2) {
	return (lum1 + 0.05) / (lum2 + 0.05);
}
return (lum2 + 0.05) / (lum1 + 0.05);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions