{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/react-native/pulls/comments/50657497","id":50657497,"diff_hunk":"@@ -167,13 +167,17 @@ function interpolate(\n function colorToRgba(\n   input: string\n ): string {\n-  var color = tinycolor(input);\n-  if (color.isValid()) {\n-    var {r, g, b, a} = color.toRgb();\n-    return `rgba(${r}, ${g}, ${b}, ${a === undefined ? 1 : a})`;\n-  } else {\n+  var int32Color = tinycolor(input);\n+  if (int32Color === null) {\n     return input;\n   }\n+\n+  var a = ((int32Color & 0xff000000) >>> 24) / 255;\n+  var r = (int32Color & 0x00ff0000) >>> 16;\n+  var g = (int32Color & 0x0000ff00) >>> 8;","path":"Libraries/Animated/src/Interpolation.js","position":16,"original_position":16,"commit_id":"311f54e3f49673dccf2880057431d72a21a9f209","original_commit_id":"311f54e3f49673dccf2880057431d72a21a9f209","user":{"login":"eslint-bot","id":16061708,"avatar_url":"https://avatars.githubusercontent.com/u/16061708?v=3","gravatar_id":"","url":"https://api.github.com/users/eslint-bot","html_url":"https://github.com/eslint-bot","followers_url":"https://api.github.com/users/eslint-bot/followers","following_url":"https://api.github.com/users/eslint-bot/following{/other_user}","gists_url":"https://api.github.com/users/eslint-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/eslint-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eslint-bot/subscriptions","organizations_url":"https://api.github.com/users/eslint-bot/orgs","repos_url":"https://api.github.com/users/eslint-bot/repos","events_url":"https://api.github.com/users/eslint-bot/events{/privacy}","received_events_url":"https://api.github.com/users/eslint-bot/received_events","type":"User","site_admin":false},"body":"no-bitwise: Unexpected use of '&'.","created_at":"2016-01-25T06:34:22Z","updated_at":"2016-01-25T06:34:22Z","html_url":"https://github.com/facebook/react-native/pull/5529#discussion_r50657497","pull_request_url":"https://api.github.com/repos/facebook/react-native/pulls/5529","_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments/50657497"},"html":{"href":"https://github.com/facebook/react-native/pull/5529#discussion_r50657497"},"pull_request":{"href":"https://api.github.com/repos/facebook/react-native/pulls/5529"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/5529","id":57032897,"html_url":"https://github.com/facebook/react-native/pull/5529","diff_url":"https://github.com/facebook/react-native/pull/5529.diff","patch_url":"https://github.com/facebook/react-native/pull/5529.patch","issue_url":"https://api.github.com/repos/facebook/react-native/issues/5529","number":5529,"state":"open","locked":false,"title":"Reimplement color processing","user":{"login":"vjeux","id":197597,"avatar_url":"https://avatars.githubusercontent.com/u/197597?v=3","gravatar_id":"","url":"https://api.github.com/users/vjeux","html_url":"https://github.com/vjeux","followers_url":"https://api.github.com/users/vjeux/followers","following_url":"https://api.github.com/users/vjeux/following{/other_user}","gists_url":"https://api.github.com/users/vjeux/gists{/gist_id}","starred_url":"https://api.github.com/users/vjeux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjeux/subscriptions","organizations_url":"https://api.github.com/users/vjeux/orgs","repos_url":"https://api.github.com/users/vjeux/repos","events_url":"https://api.github.com/users/vjeux/events{/privacy}","received_events_url":"https://api.github.com/users/vjeux/received_events","type":"User","site_admin":false},"body":"Summary:\r\n\r\n**Problem:**\r\n\r\nAs I was trying to document what color formats we supported, I realized that our current implementation based on the open source project tinycolor supported some crazy things. A few examples that were all valid:\r\n\r\n```\r\ntinycolor('abc')\r\ntinycolor(' #abc ')\r\ntinycolor('##abc')\r\ntinycolor('rgb 255 0 0')\r\ntinycolor('RGBA(0, 1, 2)')\r\ntinycolor('rgb (0, 1, 2)')\r\ntinycolor('hsv(0, 1, 2)')\r\ntinycolor({r: 10, g: 10, b: 10})\r\ntinycolor('hsl(1%, 2, 3)')\r\ntinycolor('rgb(1.0, 2.0, 3.0)')\r\ntinycolor('rgb(1%, 2%, 3%)')\r\n```\r\n\r\nThe integrations of tinycolor were also really bad. processColor added \"support\" for pure numbers and an array of colors!?? ColorPropTypes did some crazy trim().toString() and repeated a bad error message twice.\r\n\r\n**Solution:**\r\n\r\nWhile iteratively cleaning the file, I eventually ended up reimplementing it entierly. Major changes are:\r\n- The API is now dead simple: returns null if it doesn't parse or returns the int32 representation of the color\r\n- Stricter parsing of attributes. Instead of allowing all the arguments to be numbers with or without percentages, now you need to specify the correct type between integer, number and percentage.\r\n- The internals only work on int32 numbers, there's no longer tons of object creations and copy\r\n- The color map is now storing the computed value directly instead of parsing it over and over again\r\n- Made the wrapper functions just delegate to tinycolor instead of implementing diverging logic\r\n- Added unit tests on the allowed and not allowed formats\r\n- Flowified the file\r\n- Fixed a bug where hsl values with s === 0 would return the wrong result\r\n\r\n**Risk:**\r\n\r\nI'm confident that the values that were supported before still work fine. But there may be cases where people used an unsupported variant that is now going to redbox in dev and ignore the color in prod. I think that it's worth doing as what was supported was really clowny.\r\n\r\nTest Plan:\r\nUnit tests for now. I want to gather feedback and if people are happy with it I'll push it forward.","created_at":"2016-01-25T06:25:08Z","updated_at":"2016-01-25T06:34:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8411749f82960f1d5965c34b5571b4c8ae76dd95","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/react-native/pulls/5529/commits","review_comments_url":"https://api.github.com/repos/facebook/react-native/pulls/5529/comments","review_comment_url":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/5529/comments","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/311f54e3f49673dccf2880057431d72a21a9f209","head":{"label":"vjeux:color","ref":"color","sha":"311f54e3f49673dccf2880057431d72a21a9f209","user":{"login":"vjeux","id":197597,"avatar_url":"https://avatars.githubusercontent.com/u/197597?v=3","gravatar_id":"","url":"https://api.github.com/users/vjeux","html_url":"https://github.com/vjeux","followers_url":"https://api.github.com/users/vjeux/followers","following_url":"https://api.github.com/users/vjeux/following{/other_user}","gists_url":"https://api.github.com/users/vjeux/gists{/gist_id}","starred_url":"https://api.github.com/users/vjeux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjeux/subscriptions","organizations_url":"https://api.github.com/users/vjeux/orgs","repos_url":"https://api.github.com/users/vjeux/repos","events_url":"https://api.github.com/users/vjeux/events{/privacy}","received_events_url":"https://api.github.com/users/vjeux/received_events","type":"User","site_admin":false},"repo":{"id":33162154,"name":"react-native","full_name":"vjeux/react-native","owner":{"login":"vjeux","id":197597,"avatar_url":"https://avatars.githubusercontent.com/u/197597?v=3","gravatar_id":"","url":"https://api.github.com/users/vjeux","html_url":"https://github.com/vjeux","followers_url":"https://api.github.com/users/vjeux/followers","following_url":"https://api.github.com/users/vjeux/following{/other_user}","gists_url":"https://api.github.com/users/vjeux/gists{/gist_id}","starred_url":"https://api.github.com/users/vjeux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjeux/subscriptions","organizations_url":"https://api.github.com/users/vjeux/orgs","repos_url":"https://api.github.com/users/vjeux/repos","events_url":"https://api.github.com/users/vjeux/events{/privacy}","received_events_url":"https://api.github.com/users/vjeux/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vjeux/react-native","description":"A framework for building native apps with React.","fork":true,"url":"https://api.github.com/repos/vjeux/react-native","forks_url":"https://api.github.com/repos/vjeux/react-native/forks","keys_url":"https://api.github.com/repos/vjeux/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vjeux/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vjeux/react-native/teams","hooks_url":"https://api.github.com/repos/vjeux/react-native/hooks","issue_events_url":"https://api.github.com/repos/vjeux/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/vjeux/react-native/events","assignees_url":"https://api.github.com/repos/vjeux/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/vjeux/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/vjeux/react-native/tags","blobs_url":"https://api.github.com/repos/vjeux/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vjeux/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vjeux/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/vjeux/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vjeux/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/vjeux/react-native/languages","stargazers_url":"https://api.github.com/repos/vjeux/react-native/stargazers","contributors_url":"https://api.github.com/repos/vjeux/react-native/contributors","subscribers_url":"https://api.github.com/repos/vjeux/react-native/subscribers","subscription_url":"https://api.github.com/repos/vjeux/react-native/subscription","commits_url":"https://api.github.com/repos/vjeux/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/vjeux/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/vjeux/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/vjeux/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/vjeux/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/vjeux/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vjeux/react-native/merges","archive_url":"https://api.github.com/repos/vjeux/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vjeux/react-native/downloads","issues_url":"https://api.github.com/repos/vjeux/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/vjeux/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/vjeux/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/vjeux/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vjeux/react-native/labels{/name}","releases_url":"https://api.github.com/repos/vjeux/react-native/releases{/id}","deployments_url":"https://api.github.com/repos/vjeux/react-native/deployments","created_at":"2015-03-31T03:10:42Z","updated_at":"2015-04-16T22:23:52Z","pushed_at":"2016-01-25T06:23:41Z","git_url":"git://github.com/vjeux/react-native.git","ssh_url":"git@github.com:vjeux/react-native.git","clone_url":"https://github.com/vjeux/react-native.git","svn_url":"https://github.com/vjeux/react-native","homepage":"http://facebook.github.io/react-native/","size":33491,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"f68281a0d8fc6026a5c27675c086090ace19a5eb","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":29028775,"name":"react-native","full_name":"facebook/react-native","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/react-native","description":"A framework for building native apps with React.","fork":false,"url":"https://api.github.com/repos/facebook/react-native","forks_url":"https://api.github.com/repos/facebook/react-native/forks","keys_url":"https://api.github.com/repos/facebook/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/react-native/teams","hooks_url":"https://api.github.com/repos/facebook/react-native/hooks","issue_events_url":"https://api.github.com/repos/facebook/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/react-native/events","assignees_url":"https://api.github.com/repos/facebook/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/react-native/tags","blobs_url":"https://api.github.com/repos/facebook/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/react-native/languages","stargazers_url":"https://api.github.com/repos/facebook/react-native/stargazers","contributors_url":"https://api.github.com/repos/facebook/react-native/contributors","subscribers_url":"https://api.github.com/repos/facebook/react-native/subscribers","subscription_url":"https://api.github.com/repos/facebook/react-native/subscription","commits_url":"https://api.github.com/repos/facebook/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/react-native/merges","archive_url":"https://api.github.com/repos/facebook/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/react-native/downloads","issues_url":"https://api.github.com/repos/facebook/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/react-native/labels{/name}","releases_url":"https://api.github.com/repos/facebook/react-native/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/react-native/deployments","created_at":"2015-01-09T18:10:16Z","updated_at":"2016-01-25T06:27:57Z","pushed_at":"2016-01-25T06:25:08Z","git_url":"git://github.com/facebook/react-native.git","ssh_url":"git@github.com:facebook/react-native.git","clone_url":"https://github.com/facebook/react-native.git","svn_url":"https://github.com/facebook/react-native","homepage":"http://facebook.github.io/react-native/","size":72309,"stargazers_count":26227,"watchers_count":26227,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4637,"mirror_url":null,"open_issues_count":1006,"forks":4637,"open_issues":1006,"watchers":26227,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/5529"},"html":{"href":"https://github.com/facebook/react-native/pull/5529"},"issue":{"href":"https://api.github.com/repos/facebook/react-native/issues/5529"},"comments":{"href":"https://api.github.com/repos/facebook/react-native/issues/5529/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/react-native/pulls/5529/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/react-native/pulls/5529/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/react-native/statuses/311f54e3f49673dccf2880057431d72a21a9f209"}}}}