Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

deltaphistar

Myndex14AGPL v30.0.1

Delta Phi Star is a general purpose method of determining perceptual lightness contrast developed by Andrew Somers (Myndex Research), and is a sibling of APCA and SACAM. It is a simplified method using easily invertible standardized maths, however it lack

CSS, HTML, PDF, RTF, sRGB, RGB, P3, displayP3, Adobe RGB, LCh, Lstar, color, colour, contrast, lightness, brightness, luminance, luminance contrast, lightness contrast, perceptual contrast, visual contrast, color contrast, colour contrast, text contrast, APCA contrast, A11y contrast, constant contrast, accessible contrast, readability contrast, readability, accessibility, contrast sensitivity, spatial frequency, spacial frequency, design tools, design systems, design guidelines, typography, a11y, W3C, WCAG, WCAG 2, WCAG 3, SACAM, SAPC, APCA

readme

version    plain vanilla JS    license   

last commit    downloads    twitter   

𝜟𝜱✴︎ (delta phi star)

𝜟𝜱✴︎ or Delta Phi Star is a method of determining perceptual lightness contrast developed by Andrew Somers (Myndex Research), and is a sibling of APCA and SACAM. It is a simplified method using easily invertible standardized maths, however it lacks some useful properties such as polarity sensitivity.

But In fact, 𝜟𝜱✴︎ is intended for applications where a "general" simplifed perceptual contrast is desired, where polarity sensitivity is not needed or is ambiguous.

𝜟𝜱✴︎ was created on the path toward SACAM and APCA.

Here, create Lstar from the piecewise sRGB -> Y and L* per the standard CIE math (see the See Stars microlibrary), then:

    deltaPhiStar = (Math.abs(bgLstar ** 1.618 - txLstar ** 1.618) ** 0.618) * 1.414 - 40 ;

    // ** is equiv to Math.pow

This mainly works for "Light Mode" but does not track dark mode quite as well as APCA.

Also, while this is close to parity with light mode APCA for Lc +46 thru +75. The very low and very high contrasts reported by 𝜟𝜱✴︎ higher than those reported by APCA. This should be helpful as 𝜟𝜱✴︎ is not polarity sensitive the way APCA is.

As the difference has a power curve exponent of 1/𝜱 applied, the difference must be an absolute value. 𝜟𝜱✴︎ returns a positive value always, and is symmetrical in regards to polarity (text and BG order do not affect results).

delta phi star logo general purpose contrast algorithm