0.0.1 ā€¢ Published 2 years ago

deltaphistar v0.0.1

Weekly downloads
-
License
AGPL v3
Repository
github
Last release
2 years ago

šœŸšœ±āœ“ļøŽ (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