Skip to content
forked from Myndex/apca-w3

The APCA version licensed to the W3/AGWG per the collaborative agreement

License

Notifications You must be signed in to change notification settings

nschonni/apca-w3

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

APCA • THE REVOLUTION WILL BE READABLE

SAPC/Main Repo    version    plain vanilla JS    license   

last commit    downloads    twitter    APCA/Live Tool/   

apca-w3

The APCA version in this repositiory is licensed to the W3/AGWG per the collaborative agreement.

Advanced Perceptual Contrast Algorithm

Current Version: 0.0.98G-4g-w3-betafish

APCA is a contrast assessment method for predicting the perceived contrast between sRGB colors on a computer monitor. It has been developed as an assessment method for W3 Silver/WCAG3 accessibility standards relating to content for computer displays and mobile devices, with a focus on readability and understandability.

QuickStart

Usage:

First color must be text, second color must be the background.

Lc = APCAcontrast(sRGBtoY(textColor),sRGBtoY(backgroundColor));

Font Use Lookup Table

Latest Lookup Table: November 17 2021

Screen Shot 2021-11-18 at 2 26 32 AM

Screen Shot 2021-11-18 at 2 33 34 AM


EXTRAS

Additional documentation, including a plain language walkthrough, LaTeX math, and more are available at the SAPC repo.

Current APCA Constants ( 0.0.98G 4g - W3 )

These constants are for use with the web standard sRGB colorspace.

 // 0.98G-4g-W3 constants (W3 license only):
    
  Exponents =  { mainTRC: 2.4,       normBG: 0.56,       normTXT: 0.57,     revTXT: 0.62,     revBG: 0.65, };
  
  ColorSpace = { sRco: 0.2126729,    sGco: 0.7151522,    sBco: 0.0721750, };
    
  Clamps =     { blkThrs: 0.022,     blkClmp: 1.414,     loClip: 0.1,     deltaYmin: 0.0005, };
        
  Scalers =    { scaleBoW: 1.14,     loBoWoffset: 0.027, 
                 scaleWoB: 1.14,     loWoBoffset: 0.027, };	

There is a working version with examples and reference material on the APCA site

APCA is the Advanced Perceptual Contrast Algorithm

THE REVOLUTION WILL BE READABLE™

About

The APCA version licensed to the W3/AGWG per the collaborative agreement

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 90.1%
  • HTML 9.9%