/*
向调色板实例添加自己独有的颜色名称，对已存在的颜色名称， 将会覆盖掉
@param name 新添加的颜色名称
@param value 新添加的颜色名称所对应的值， 可以是一个合法的颜色字符串或者是一个color对象
@return 新添加的颜色的值
960785
function(name, value) {
                if (typeof value === "string") {
                    this.color[name] = new Color(value).toRGBA();
                } else {
                    this.color[name] = value.toRGBA();
                }
                return value;
            }
987730
public static ChainableStatement css(String name, String value)
	{
		return new DefaultChainableStatement("css", JsUtils.quotes(name), JsUtils.quotes(value));
	}
1374816
public synchronized Object put(Object name,Object value)
    {
        if (_initParams==null)
            _initParams=new HashMap(3);
        return _initParams.put(name,value);
    }
173870
public static Color getRGBColor(String name)
			throws IllegalArgumentException {
		int[] c = { 0, 0, 0, 0 };
		if (name.startsWith("#")) {
			if (name.length() == 4) {
				c[0] = Integer.parseInt(name.substring(1, 2), 16) * 16;
				c[1] = Integer.parseInt(name.substring(2, 3), 16) * 16;
				c[2] = Integer.parseInt(name.substring(3), 16) * 16;
				return new Color(c[0], c[1], c[2], c[3]);
			}
			if (name.length() == 7) {
				c[0] = Integer.parseInt(name.substring(1, 3), 16);
				c[1] = Integer.parseInt(name.substring(3, 5), 16);
				c[2] = Integer.parseInt(name.substring(5), 16);
				return new Color(c[0], c[1], c[2], c[3]);
			}
			throw new IllegalArgumentException(
					"Unknown color format. Must be #RGB or #RRGGBB");
		}
        else if (name.startsWith("rgb(")) {
            StringTokenizer tok = new StringTokenizer(name, "rgb(), \t\r\n\f");
            for (int k = 0; k < 3; ++k) {
                String v = tok.nextToken();
                if (v.endsWith("%"))
                    c[k] = Integer.parseInt(v.substring(0, v.length() - 1)) * 255 / 100;
                else
                    c[k] = Integer.parseInt(v);
                if (c[k] < 0)
                    c[k] = 0;
                else if (c[k] > 255)
                    c[k] = 255;
            }
            return new Color(c[0], c[1], c[2], c[3]);
        }
		name = name.toLowerCase();
		if (!NAMES.containsKey(name))
			throw new IllegalArgumentException("Color '" + name
					+ "' not found.");
		c = (int[]) NAMES.get(name);
		return new Color(c[0], c[1], c[2], c[3]);
	}
468364
public static <T> Const<T> of(final String name, final T value) {
		return new Const<>(requireNonNull(name), value);
	}
1001646
public HttpRequestBuilder addHeader(String name, String value) {
    if (value != null) {
      reqHeaders.put(name, value);
    }
    return this;
  }
412154
public void addParam(String name, String value) {
        getParams().add(new BasicNameValuePair(name, value));
    }
318929
public void addName(String name)
   {
      if (names.contains(name))
      {
         throw new IllegalArgumentException("already contains: " + name);
      }
      indexes.add(name);
      names.add(name);
      dirty = true;
   }
488521
public void appendOptionalAttribute(final String name, final Object value) {
		if (value != null) {
			appendAttribute(name, value);
		}
	}
621605
public T query(String name, Object value) {
        this.query(name, value, true);
        return returnThis();
    }
410650
@SuppressWarnings("unchecked")
    public <R> R put(@NotNull final String name, R value) {
        if (value == null) {
            return (R) context.remove(name);
        }
        return (R) context.put(name, value);
    }
792195
static List<String> stringWithEq(String name, @Nullable String value) {
    if (!Strings.isNullOrEmpty(value)) {
      return Collections.singletonList("--" + name + "=" + value);
    }
    return Collections.emptyList();
  }
132072
public static Header of(String name, Object value) {
        return new Header(requireNonNull(name), String.valueOf(requireNonNull(value)));
    }
640705
public OqlBuilder<T> param(String name, Object value) {
    params.put(name, value);
    return this;
  }
101553
public static String setProperty(String name, String value) {
        String val = null;
        if(props.containsKey(name)){
            val = props.get(name).getValue();
        }
        props.put(name, new Property(name, value, "dynamically added"));
        LOGGER.warn("Temporary overriding property: " + name + ". Old value: " + val + ". New value: "  + value);
        return val;
    }
180477
public void setValueFor(Object value, String name) {
        getMapHelper().setValueForIn(value, name, getCurrentValues());
    }
1192794
public List<V> put(String name, V value) {
        if (value == null) {
            return super.put(name, null);
        }
        List<V> vals = new ArrayList<>();
        vals.add(value);
        return put(name, vals);
    }