File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 // then use the contrast() utility function
88 // to compute WCAG contrast.
99
10+ var back = document . querySelector ( #fg) ;
11+ var fore = document . querySelector ( #bg) ;
12+ back . addEventListener ( "input" , updateFirst , false ) ;
13+ fore . addEventListener ( "input" , updateFirst , false ) ;
1014
15+ function watchpickers ( event ) {
16+ // if either picker changes,
17+ }
1118 </ script >
1219 < style >
1320 body {background-color : rgb (46.6346021727084% , 46.6346021727084% , 46.6346021727084% ); padding : 20px ;}
1421 h2 {color : rgb (243 , 235 , 166 );}
1522 </ style >
1623 < h2 > Contrast ratio of two colors</ h2 >
1724 < p > Pick a foreground and background color</ p >
18- < input type ="color " id ="fg " value ="#739 ">
25+ < input type ="color " id ="fg " value ="#B7C9A3 ">
1926 < label for ="fg "> Foreground</ label >
20- < input type ="color " id ="fg " value ="#142 ">
27+ < input type ="color " id ="fg " value ="#104425 ">
2128 < label for ="fg "> Background</ label >
2229
2330 < div id ="result ">
Original file line number Diff line number Diff line change 11// utility functions for color conversions
2- import " conversions.js" ;
2+ // needs conversions.js nd math.js (not Math)
33
44function sRGB_to_luminance ( RGB ) {
55 // convert an array of gamma-corrected sRGB values
You can’t perform that action at this time.
0 commit comments