private static Integer getComponent(Object value) {
    if (value instanceof Number) {
      int component = ((Number)value).intValue();
      if (component >= 0 && component <= 255) {
        return component;
      }
    }
    return null;
  }
private static Integer getComponent(Object value)