code: function(v) {
                  if (isNumber(v)) {
                      v = Math.min(Math.max(0, v), 255);
                      var i, next;
                      for (i=0; i<256; i=i+51) {
                          next = i+51;
                          if (v >= i && v <= next) {
                              return (v-i > 25) ? next : i;
                          }
                      }
                  }
  
                  return v;
              }
docs: returns the closest match [0, 51, 102, 153, 204, 255]