Blijbol.nl

Blijbol, happy business   Dutch English

Links About Blijbol Guestbook
Home News Games Software Game Maker
Downloaded 22 times

Color Contrast Checker

Determine accessibility of a color pair

Description

Enter two colors in hexadecimal notation and check their relative luminescences and contrast ratio, and whether this contrast ratio is sufficient for normal or large text according to the Web Content Accessibility Guidelines 2.0.

Tip: use in conjunction with Base Convertor.



Codes

Licence: Use the program below at your own risk. You are only allowed to change this source code for private usage. Any adapted version of this program cannot be distributed. The text 'Blijbol.nl' must remain clearly visible from within the program. Copyright 2011 Jeroen van der Gun.
PROGRAM:CONTRAST
:ClrHome
:Full
:Output(8,4,"Blijbol.nl
:Disp "
:Normal
:Fix 3
:1→J
:Input "C1=x",Str0
:Lbl 2
:If 3=length(Str0
:sub(Str0,1,1)+sub(Str0,1,1)+sub(Str0,2,1)+sub(Str0,2,1)+sub(Str0,3,1)+sub(Str0,3,1→Str0
:If 6≠length(Str0
:Goto 1
:0→L
:For(I,0,5
:inStrin"0123456789ABCDEF",sub(Str0,6-I,1
:If not(Ans
:Goto 1
:If fPart(I/2
:Then
:(X+16(Ans-1))/255
:If Ans≤.03928
:Then
:Ans/12.96
:Else
:((Ans+.055)/1.055)^2.4
:End
:If I=5
:.2126Ans
:If I=3
:.7152Ans
:If I=1
:.0722Ans
:L+Ans→L
:Else
:Ans-1→X
:End
:End
:If J=1
:Then
:Disp "L1="
:Output(3,4,Ans
:L→K
:2→J
:Input "C2=x",Str0
:Goto 2
:End
:Disp "L2="
:Output(5,4,Ans
:Fix 1
:(.05+max(K,L))/(.05+min(K,L
:Disp "Ratio="
:Output(6,7,Ans
:If Ans>7
:Then
:Disp "WCAG:AAA
:Else
:If Ans>4.5
:Then
:Disp "WCAG:AA-AAA
:Else
:If Ans>3
:Then
:Disp "WCAG:A-AA
:Else
:Disp "WCAG:A
:End
:End
:End
:Pause
:Lbl 0
:Float
:ClrHome
:Stop
:Lbl 1
:Menu("ERR:SYNTAX","Quit",0

Version 1.0 (stable)

Release date: 16 December 2011
Language: English
System requirements: Texas Instruments graphing calculator running TI-83 Plus or TI-84 Plus operating system (Silver Edition is also fine), 580 bytes free RAM memory or archive space for storage (during use more RAM memory is needed)

Project status

A stable version of this product has been released. The project was announced at 16 December 2011.

Credits

This tool has been created by Jeroen van der Gun.

More for your calculator



Comments

No comments have been posted yet. Use the form to post one.

Add a comment




1 × 1 =
Blijbol =