-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Colored text should be made more accessible #6486
Comments
I think there are new contrast color guidelines coming out, but I can't find automation for it ATT. |
Hello @tomByrer @guidezpl I'm going to answer this in two parts. I • New Contrast InfoThere is indeed for WCAG_3 a new contrast method, do note that it is not "backwards" compatible with WCAG_2 contrast, though it is useable now if you do not have a contractual or legal requirement for using specifically WCAG_2 or 2.1 As WCAG_2 and 3 are in scope only for web content, other contrast guidance can be used, depending on the medium. Per laws such as the United States ADA, accessibility for web sites IS required, but ADA does not specify WCAG_2 are the required standard for non-governmental sites. (Your Mileage May Vary!!) II • It's Not Easy Being Green....Especially if you need to be the darkest color. Keep in mind that the vast majority of luminance (lightness) comes from the green primary in the monitor. Green is the only primary that can reasonably be alone against black. In opposition, green has a problem against white, and must be set very dark. Thank you Andy |
OOPS forgot, here's the npm install, import, and useage: QuickStartInstall npm i apca-w3 Import import { APCAcontrast, sRGBtoY, displayP3toY, colorParsley } from 'apca-w3'; Usage:PARSE: let rgbaArray = colorParsley('aliceblue'); CONVERT TO Ys let Ys = sRGBtoY([123,123,123,1.0]); FIND Lc CONTRAST let textColor = [17,17,17,255];
let backgroundColor = [232,230,221,255];
let contrastLc = APCAcontrast( sRGBtoY( textColor ), sRGBtoY( backgroundColor ) ); String TheoryThe following are the available input types for colorParsley(), HSL is not implemented at the moment. All are automatically recognized: INPUT as STRINGS:
INPUT as NUMBER:
No alpha parsing for numbers in part as there are big and little endian issues that need to be resolved. Parsing RemovalThe function is called "colorParsley()" because what is that useless leafy thing the restaurant puts on the plate? Well, most mature software already has good parsing, and you may want to minimize the file leaving all that "parsley" at the restaurant. In the src folder .js file, there is a This changes the import you need to use to: // import with parsing off/removed:
import { APCAcontrast, sRGBtoY, displayP3toY } from 'apca-w3'; Font Use Lookup TableLatest Lookup Table: Dec 17 2021 // APCA FONT LOOKUP TABLE 0.98G-4g-b3
// Font Size and Reference Font Weight
// THIS GRID FOR FLUENT TEXT USE CASE ONLY DEC 12 2021
const apcaFluentGrid = [
["min", "min", "min", "min", "min", "min", "min", "min", "min"],
["min", "min", "min", "min", "min", "min", "min", "min", "min"],
["min", "min", "min", 95, 90, 85, 80, "min", "min"],
["min", "min", "min", 90, 85, 80, 75, "min", "min"],
["min", "min", 95, 80, 75, 65, 60, 55, "min"],
["min", "min", 90, 75, 65, 60, 55, 50, 45],
["min", 95, 85, 65, 60, 55, 50, 45, 40],
["min", 90, 75, 60, 55, 50, 45, 40, 35],
["min", 85, 70, 55, 50, 45, 40, 35, 30],
[90, 75, 60, 50, 45, 40, 35, 30, "max"],
[85, 70, 55, 45, 40, 35, 30, "max", "max"],
[75, 60, 50, 40, 35, 30, "max", "max", "max"],
[70, 55, 45, 35, 30, "max", "max", "max", "max"],
[60, 45, 40, 30, "max", "max", "max", "max", "max"],
]; Thank you! Andy |
This issue is being addressed in #9427. Closing this issue as a duplicate. |
Describe the problem
The accessibility of the blue and green text used throughout the site could be improved
![Screenshot 2021-11-18 at 17 17 22](https://user-images.githubusercontent.com/6655696/142454109-3577c407-f9c3-42f6-ae1c-1dedb55fd44e.png)
For exampleExpected fix
Darken the colors used
Additional context
No response
The text was updated successfully, but these errors were encountered: