diff options
Diffstat (limited to 'exampleData/ruleSets/colorRules/foregroundCheck.js')
-rw-r--r-- | exampleData/ruleSets/colorRules/foregroundCheck.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/exampleData/ruleSets/colorRules/foregroundCheck.js b/exampleData/ruleSets/colorRules/foregroundCheck.js new file mode 100644 index 0000000..5b1e04b --- /dev/null +++ b/exampleData/ruleSets/colorRules/foregroundCheck.js @@ -0,0 +1,16 @@ +exports.name = 'Background Check'; + +exports.description = + [ 'Backgrounds colors should be in the set:' + , '#00 #FF #3D #F7 #C2 #B4 #4E' + ].join('\n'); + +exports.rule = function() { + var allow = '#00 #FF #3D #F7 #C2 #B4 #4E #FFCB05 #7B8738'.split(' '); + $5(':visible') + .cssIsNot('color', allow, fiveui.color.colorToHex) + .each(function(i, elt) { + var color = fiveui.color.colorToHex($(elt).css('color')); + report('foreground color: ' + color, elt); + }); +}; |