将长度字符串转换为以px为单位的字符串
@param  {String} val 表示长度的css表达式字符串
@return {String}     以px为单位的数字字符串
776606
function px (val) {
	try {
		val = parseFloat(parseLength(val).toFixed(4));
		if (val === 0) {
			return "0";
		} else {
			return val + "px";
		}
	} catch (ex) {
		return val;
	}
}
849843
function (name, val) {
            function exec(name, val) {
                var reg = new RegExp('(^|;)\\s*' + name + ':([^;]+;?)', 'gi');
                cssStyle = cssStyle.replace(reg, '$1');
                if (val) {
                    cssStyle = name + ':' + utils.unhtml(val) + ';' + cssStyle
                }

            }

            var cssStyle = this.getAttr('style');
            if (!cssStyle) {
                cssStyle = '';
            }
            if (utils.isObject(name)) {
                for (var a in name) {
                    exec(a, name[a])
                }
            } else {
                exec(name, val)
            }
            this.setAttr('style', utils.trim(cssStyle))
        }
233065
private static CSSClipRect  parseClip(String val)
   {
      if ("auto".equals(val))
         return null;
      if (!val.startsWith("rect("))
         return null;

      TextScanner scan = new TextScanner(val.substring(5));
      scan.skipWhitespace();

      Length top = parseLengthOrAuto(scan);
      scan.skipCommaWhitespace();
      Length right = parseLengthOrAuto(scan);
      scan.skipCommaWhitespace();
      Length bottom = parseLengthOrAuto(scan);
      scan.skipCommaWhitespace();
      Length left = parseLengthOrAuto(scan);

      scan.skipWhitespace();
      if (!scan.consume(')') && !scan.empty())   // Be forgibing. Allow missing ')'.
         return null;

      return new CSSClipRect(top, right, bottom, left);
   }
1170035
function valToString(val, hasSign) {

      var str = "";

      if (Complex && val instanceof Complex) {

        if (val['im'] === 0) {

          if (val['re'] > 0 && hasSign) {
            str += "+";
          }
          str += val['re'];

        } else if (val['re'] === 0) {

          if (val['im'] === -1) {
            str += "-";
          } else if (val['im'] !== 1) {

            if (val['im'] > 0 && hasSign) {
              str += "+";
            }
            str += val['im'];
          } else {
            if (val['im'] > 0 && hasSign) {
              str += "+";
            }
          }
          str += "i";

        } else {

          if (hasSign) {
            str += "+";
          }

          str += "(";
          str += val.toString();
          str += ")";
        }

        return str;

      } else {

        if (val > 0 && hasSign) {
          str += "+";
        }
        str += val.toString();
      }
      return str;
    }
532296
public String
getText(int val) {
	check(val);
	String str = (String) values.get(toInteger(val));
	if (str != null)
		return str;
	str = Integer.toString(val);
	if (prefix != null)
		return prefix + str;
	return str;
}
1156494
function(val) {
      return val === undefined ? (this.length ? this[0].clientHeight || this[0].innerHeight : 0) : this.each(function(index, el) {
        el.style.height = val + 'px';
      });
    }
1334290
function(props, val) {
      if (/^o/.test(typeof props)) {
        for(var prop in props) {
          var prefixed = u.prfx(prop);
          if (props.hasOwnProperty(prop)) {
            this.each(function(index, el) {
              el.style[prefixed] = props[prop];
            });
          }
        }
        return this;
      }
      else {
        return val === undefined ? (this.length ? getComputedStyle(this[0])[props] : null) : this.each(function(index, el) {
          var prefixed = u.prfx(props);
          el.style[prefixed] = val;
        });
      }
    }
562637
function(type, val){
    var res = {type: type, line: this.lineno, col: this.colno};

    if (val !== undefined) res.val = val;

    return res;
  }
627251
public static final Color getColorForValue(double val) {
    // Color positions
    double[] pos = new double[] { 0.0, 0.6, 0.8, 1.0 };
    // Colors at these positions
    Color[] cols = new Color[] { new Color(0.0f, 0.0f, 0.0f, 0.6f), new Color(0.0f, 0.0f, 1.0f, 0.8f), new Color(1.0f, 0.0f, 0.0f, 0.9f), new Color(1.0f, 1.0f, 0.0f, 1.0f) };
    assert (pos.length == cols.length);
    if(val < pos[0]) {
      val = pos[0];
    }
    // Linear interpolation:
    for(int i = 1; i < pos.length; i++) {
      if(val <= pos[i]) {
        Color prev = cols[i - 1];
        Color next = cols[i];
        final double mix = (val - pos[i - 1]) / (pos[i] - pos[i - 1]);
        final int r = (int) ((1 - mix) * prev.getRed() + mix * next.getRed());
        final int g = (int) ((1 - mix) * prev.getGreen() + mix * next.getGreen());
        final int b = (int) ((1 - mix) * prev.getBlue() + mix * next.getBlue());
        final int a = (int) ((1 - mix) * prev.getAlpha() + mix * next.getAlpha());
        Color col = new Color(r, g, b, a);
        return col;
      }
    }
    return cols[cols.length - 1];
  }
95571
function getCss(elem, attr) {
    const val = win.getComputedStyle(elem)[attr];

    // 对于属性值是 200px 这样的形式，返回 200 这样的数字值
    return regExp.styleValue.test(val) ? pInt(val) : val;
}
1066354
def pok(self, val, ok='OK'):
        
        self.pstd(self.color.green('{}: {}'.format(val, ok)))
1107426
function(styles, val) {
                    var el;
                    var key;
                    var cptStyle;
                    var getCptStyle = window.getComputedStyle;
                    if(_type(styles) == TYPES.s) {
                        if(val === undefined) {
                            el = this[0];
                            cptStyle = getCptStyle ? getCptStyle(el, null) : el.currentStyle[styles];

                            //https://bugzilla.mozilla.org/show_bug.cgi?id=548397 can be null sometimes if iframe with display: none (firefox only!)
                            return getCptStyle ? cptStyle != null ? cptStyle.getPropertyValue(styles) : el[LEXICON.s][styles] : cptStyle;
                        }
                        else {
                            return this.each(function() {
                                setCSSVal(this, styles, val);
                            });
                        }
                    }
                    else {
                        return this.each(function() {
                            for(key in styles)
                                setCSSVal(this, key, styles[key]);
                        });
                    }
                }
392122
function resolveStyleValue(cssProperty, value) {
    if (typeof value === "number") {
        return isUnitlessProperty[cssProperty] || value === 0 ?
            ("" + value) :
            (value + "px");
    } else {
        return value ? ("" + value) : "";
    }
}
838859
function slugify(val) {
    if (!is_1.isValue(val))
        return null;
    val = val.replace(/^\s+|\s+$/g, '').toLowerCase();
    // replace accents etc.
    var from = 'ãàáäâẽèéëêìíïîõòóöôùúüûñç·/_,:;';
    var to = 'aaaaaeeeeeiiiiooooouuuunc------';
    for (var i = 0, l = from.length; i < l; i++) {
        val = val.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
    }
    val = val.replace(/[^a-z0-9 -]/g, '') // replace invalid chars.
        .replace(/\s+/g, '-') // replace whitespace with -
        .replace(/-+/g, '-'); // replace multiple dashes with single.
    return val;
}
331210
function width (val) {
  var cr = val.indexOf(EOL);
  if (cr !== -1) {
    val = val.substring(0, cr);
  }
  if (typeof val !== 'string') {
    val = val + '';
  }
  var h = val.match(/[ -~]/g);
  return val.length * 2 - (h ? h.length : 0);
}
385282
function relative_px(type, value) {
          var w = window,
            d = document,
            e = d.documentElement,
            g = d.body,
            x = w.innerWidth || e.clientWidth || g.clientWidth,
            y = w.innerHeight || e.clientHeight || g.clientHeight;

          if (type === 'vw') {
            return (x * parseFloat(value)) / 100;
          } else if (type === 'vh') {
            return (y * parseFloat(value)) / 100;
          } else {
            return undefined;
          }
        }
883001
function(val) {
      return new Color(
        val ? val : null,
        this.options.colorSelectors,
        this.options.fallbackColor ? this.options.fallbackColor : this.color,
        this.options.fallbackFormat,
        this.options.hexNumberSignPrefix
      );
    }