{"id":5895,"date":"2025-05-15T14:09:12","date_gmt":"2025-05-15T19:09:12","guid":{"rendered":"https:\/\/frontendmasters.com\/blog\/?p=5895"},"modified":"2025-05-15T14:09:13","modified_gmt":"2025-05-15T19:09:13","slug":"contrast-color-ships-in-safari-technology-preview","status":"publish","type":"post","link":"https:\/\/frontendmasters.com\/blog\/contrast-color-ships-in-safari-technology-preview\/","title":{"rendered":"contrast-color() ships in Safari\u00a0Technology\u00a0Preview"},"content":{"rendered":"\n<p><a href=\"https:\/\/css-tricks.com\/exploring-color-contrast-for-the-first-time\/\">When I first looked at the new color contract function in CSS<\/a>, the words were reversed, so that&#8217;s notable. It&#8217;s <code><a href=\"https:\/\/webkit.org\/blog\/16929\/contrast-color\/\">contrast-color()<\/a><\/code> now, and starting it&#8217;s life in Safari Technology Preview. Now it only takes <strong>one<\/strong> argument, a color, and you get back either <code>black<\/code> or <code>white<\/code> (rather than providing your own color choices). Once this makes it&#8217;s way to a browser support level you&#8217;re comfortable with, it seems like a nicely low-effort way to ensure an accessible color to sit on top of an unknown background, so long as that background is a solid color. Except that it&#8217;s using the WCAG 2 algorithm to make the choices, and it has some notable limitations, including literally make the wrong call. But it&#8217;s possible the underlying algorithm gets updated to <a href=\"https:\/\/git.apcacontrast.com\/documentation\/APCAeasyIntro\">APCA<\/a>, which seems <em>much<\/em> smarter, doing things like factoring in size and weight, but it&#8217;s unclear if browsers will ever be allowed to use it Because Drama\u2122.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When I first looked at the new color contract function in CSS, the words were reversed, so that&#8217;s notable. It&#8217;s contrast-color() now, and starting it&#8217;s life in Safari Technology Preview. Now it only takes one argument, a color, and you get back either black or white (rather than providing your own color choices). Once this [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5896,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[29],"tags":[49,81,346,7],"class_list":["post-5895","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-the-beat","tag-accessibility","tag-color","tag-color-contrast","tag-css"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/05\/Screenshot-2025-05-15-at-12.08.45%E2%80%AFPM.png?fit=1504%2C838&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/5895","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/comments?post=5895"}],"version-history":[{"count":1,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/5895\/revisions"}],"predecessor-version":[{"id":5897,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/5895\/revisions\/5897"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media\/5896"}],"wp:attachment":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media?parent=5895"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/categories?post=5895"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/tags?post=5895"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}