diff options
author | Benjamin Jones <bjones@galois.com> | 2013-06-14 12:14:59 -0700 |
---|---|---|
committer | Benjamin Jones <bjones@galois.com> | 2013-06-14 12:14:59 -0700 |
commit | d872a302ab76bdee747d4042a16b831b48ff5859 (patch) | |
tree | ec603cead1aa0e951d8a8b3eb3ae08e93d3f7123 /exampleData/ruleSets | |
parent | c1d8d80f7fa3ec99e402f8bfe0aeac1a0bc257f7 (diff) |
fixed problems with fiveui.color.findBGColor, added a test_color.html, updated colorBrightness rule
Diffstat (limited to 'exampleData/ruleSets')
-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> + |