aboutsummaryrefslogtreecommitdiff
path: root/exampleData/ruleSets/colorRules/backgroundCheck.js
blob: 98df08c3fb7ef65de119dda817b6a27323eb7737 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

exports.name = 'Foreground Check';

exports.description =
  [ 'Foreground colors should be in the set:'
  , '#00 #FF #3D #F7 #C2 #B4 #4E #FFCB05 #7B8738'
  ].join('\n');

exports.rule = function() {
  var allow = '#00 #FF #3D #F7 #C2 #B4 #4E'.split(' ');
  this.report("broken");
  $5(':visible')
    .cssIsNot('background-color', allow, fiveui.color.colorToHex)
    .each(function(i, elt) {
            var color = fiveui.color.colorToHex($(elt).css('background-color'));
            this.report('non-standard background color: ' + color, $(elt));
          });
};