aboutsummaryrefslogtreecommitdiff
path: root/exampleData
diff options
context:
space:
mode:
authorGravatar Rogan Creswick <creswick@gmail.com>2013-06-14 15:29:50 -0700
committerGravatar Rogan Creswick <creswick@gmail.com>2013-06-14 15:29:50 -0700
commitf8c37c2ca06b3185ce988b6fd3552f0ea2ea27fa (patch)
treeb13abc784d2b7262d2f4ffb73b66ae337da363fe /exampleData
parenta62026d7e1e0327b741d74c8a02bfcb3765f8b86 (diff)
parent038b25568753863542b2571c71b7f42ccd70fa3b (diff)
Merge remote-tracking branch 'origin/master' into nlp-rules
Diffstat (limited to 'exampleData')
-rw-r--r--exampleData/ruleSets/accessibility/colorBrightness.js1
-rw-r--r--exampleData/ruleSets/accessibility/test_color.html22
-rw-r--r--exampleData/ruleSets/colorRules.json1
3 files changed, 24 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>
+
diff --git a/exampleData/ruleSets/colorRules.json b/exampleData/ruleSets/colorRules.json
index bcfce72..300793a 100644
--- a/exampleData/ruleSets/colorRules.json
+++ b/exampleData/ruleSets/colorRules.json
@@ -6,6 +6,7 @@
{ "name": "Color Guidelines"
, "description": "Foreground/background color guidelines"
+, "license": "BSD3"
, "rules":
[ "colorRules/foregroundCheck.js"
, "colorRules/backgroundCheck.js"