google / transitfeed

A Python library for reading, validating, and writing transit schedule information in the GTFS format.
https://github.com/google/transitfeed/wiki
Apache License 2.0
679 stars 254 forks source link

use w3 color contrast algorithm #108

Open bdferris opened 9 years ago

bdferris commented 9 years ago

From tom.brow...@gmail.com on November 05, 2008 20:39:27

Could we change the contrast check for the feed validator and Transit to be the w3c requirement? The w3c requirement is found here: http://juicystudio.com/services/colourcontrast.php#contrast Then the GTFS doc wouldn't have to explain contrast and could just point people to existing resources, like this handy contrast picker. http://snook.ca/technical/colour_contrast/colour.html And, even better, we would have the warm happy joy of knowing that our contrast colors for routes were fully accessible to viewers with vision impairment. Everyone wins!

Original issue: http://code.google.com/p/googletransitdatafeed/issues/detail?id=108

bdferris commented 9 years ago

From tom.brow...@gmail.com on October 28, 2009 15:57:24

The hardest part of this change is making the proposal to gtfs-changes.

Owner: ---
Labels: Priority-Medium Difficulty-Easy

bdferris commented 9 years ago

From tom.brow...@gmail.com on November 11, 2009 06:18:27

(No comment was entered for this change.)

Status: Accepted
Owner: arnoegw.code

bdferris commented 9 years ago

From arnoegw.code@gmail.com on November 11, 2009 09:37:17

The current public GTFS spec (dated March 30, 2009) already says:

The color difference between route_color and route_text_color should provide sufficient contrast when viewed on a black and white screen. http://www.w3.org/TR/AERT#color-contrast offers a useful algorithm for evaluating color contrast.

I will switch the luminance computation in the transitfeed code to the formula from that doc but leave the threshold for a warning lower than their recommendation (similar to where it was before), because they talk about running, normal-size text, which has higher demands than line names that are not read at a longer stretch and are probably shown in bigger font.

While doing this, I noticed that the spec's W3C reference is outdated.  (In fact, it's a 9 year old draft(!).)  The current thing seems to be this: http://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast Its formula is more involved, and we should first discuss what we want in the spec before writing code for it.

bdferris commented 9 years ago

From arnoegw.code@gmail.com on November 11, 2009 11:13:45

My fix announced above was reviewed by Tom at http://codereview.appspot.com/154054 and committed to SVN in revision 1145 .  I'm keeping this issue open because of the future work identified above.