{ "@context": "https://schema.org", "@id": "https://webspecification.com/spec/accessibility/contrast-color.jsonld", "@graph": [ { "@type": "TechArticle", "@id": "https://webspecification.com/spec/accessibility/contrast-color/#article", "headline": "Automatic contrasting colour", "description": "Let the browser pick a legible black or white foreground for a dynamic background with the CSS contrast-color() function, instead of hard-coding colour pairs or computing luminance in JavaScript.", "url": "https://webspecification.com/spec/accessibility/contrast-color/", "inLanguage": "en", "isPartOf": { "@type": "WebSite", "@id": "https://webspecification.com/#website", "name": "Web Specification Studio", "url": "https://webspecification.com" }, "author": { "@type": "Person", "name": "Web Specification Studio", "url": "https://webspecification.com" }, "publisher": { "@type": "Organization", "@id": "https://webspecification.com/#organization", "name": "Web Specification Studio", "url": "https://webspecification.com" }, "license": "https://creativecommons.org/licenses/by/4.0/", "dateModified": "2026-07-04T00:00:00.000Z", "citation": [ { "@type": "CreativeWork", "name": "CSS Color Module Level 5 — contrast-color()", "url": "https://drafts.csswg.org/css-color-5/#contrast-color", "publisher": { "@type": "Organization", "name": "W3C CSS Working Group" } }, { "@type": "CreativeWork", "name": "WCAG 1.4.3 — Contrast (Minimum) (Level AA)", "url": "https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html", "publisher": { "@type": "Organization", "name": "W3C" } }, { "@type": "CreativeWork", "name": "MDN — contrast-color()", "url": "https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/color_value/contrast-color", "publisher": { "@type": "Organization", "name": "MDN" } }, { "@type": "CreativeWork", "name": "How to have the browser pick a contrasting color in CSS", "url": "https://webkit.org/blog/16929/contrast-color/", "publisher": { "@type": "Organization", "name": "WebKit" } } ] }, { "@type": "BreadcrumbList", "@id": "https://webspecification.com/spec/accessibility/contrast-color/#breadcrumb", "itemListElement": [ { "@type": "ListItem", "position": 1, "name": "Home", "item": "https://webspecification.com/" }, { "@type": "ListItem", "position": 2, "name": "Spec", "item": "https://webspecification.com/spec/" }, { "@type": "ListItem", "position": 3, "name": "Accessibility", "item": "https://webspecification.com/spec/accessibility/" }, { "@type": "ListItem", "position": 4, "name": "Automatic contrasting colour", "item": "https://webspecification.com/spec/accessibility/contrast-color/" } ] } ] }