aboutsummaryrefslogtreecommitdiff
path: root/exampleData/ruleSets
diff options
context:
space:
mode:
Diffstat (limited to 'exampleData/ruleSets')
-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"