diff options
Diffstat (limited to 'exampleData')
-rw-r--r-- | exampleData/ruleSets/accessibility/colorBrightness.js | 1 | ||||
-rw-r--r-- | exampleData/ruleSets/accessibility/test_color.html | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/exampleData/ruleSets/accessibility/colorBrightness.js b/exampleData/ruleSets/accessibility/colorBrightness.js index 79f99e1..2f5db75 100644 --- a/exampleData/ruleSets/accessibility/colorBrightness.js +++ b/exampleData/ruleSets/accessibility/colorBrightness.js @@ -34,6 +34,7 @@ exports.rule = function(report) { // TODO take into account alpha values in the foreground var fg = fc.colorToRGB($(this).css('color')); var bg = fc.findBGColor($(this)); + if (fg && bg) { var diff = brightDiff(fg, bg); if (diff < MIN_DIFF) { diff --git a/exampleData/ruleSets/accessibility/test_color.html b/exampleData/ruleSets/accessibility/test_color.html new file mode 100644 index 0000000..dee2ec1 --- /dev/null +++ b/exampleData/ruleSets/accessibility/test_color.html @@ -0,0 +1,22 @@ +<html> + <head> + <title>Test color rules</title> + </head> + <body> + + <div style="background-color: #222222"> + <p>Can you read this?</p> + </div> + + + <div style="background-color: #FFFFFF"> + <p>this is white + <span id=foobar style="background-color: rgba(255, 0, 0, 0.5)"> + this is pink + </span> + </p> + </div> + + </body> +</html> + |