{"action":"created","comment":{"url":"https://api.github.com/repos/bgrins/TinyColor/pulls/comments/23201277","id":23201277,"diff_hunk":"@@ -396,29 +406,46 @@ Combination functions return an array of TinyColor objects unless otherwise note\n \n ### random\n \n-Returns a random color\n+Returns a random color.\n ```js\n var color = tinycolor.random();\n color.toRgb(); // \"{r: 145, g: 40, b: 198, a: 1}\"\n ```\n \n-### readability\n+### Readability\n+TinyColor assesses readability based on the [Web Content Accessibility Guidelines (Version 2.0)](http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef).\n \n-`readable: function(TinyColor, TinyColor) -> Object`.  Analyze 2 colors and returns an object with the following properties.  `brightness` is difference in brightness between the two colors.  `color`: difference in color/hue between the two colors.\n+#### readability\n \n-    tinycolor.readability(\"#000\", \"#111\"); // {brightness: 17, color: 51}\n-    tinycolor.readability(\"#000\", \"#fff\"); // {brightness: 255, color: 765}\n+`readability: function(TinyColor, TinyColor) -> Object`.\n+Returns the contrast ratio between two colors.\n \n-### isReadable\n+    tinycolor.readability(\"#000\", \"#000\"); // 1\n+    tinycolor.readability(\"#000\", \"#111\"); // 1.1121078324840545\n+    tinycolor.readability(\"#000\", \"#fff\"); // 21\n \n-`isReadable: function(TinyColor, TinyColor) -> Boolean`.  Ensure that foreground and background color combinations provide sufficient contrast.\n+Use the values in your own calculations, or use one of the convenience functions below.\n \n-    tinycolor.isReadable(\"#000\", \"#111\"); // false\n+#### isReadable\n \n-### mostReadable\n+`isReadable: function(TinyColor, TinyColor, Object) -> Boolean`.  Ensure that foreground and background color\n+combinations meet WCAG guidelines. `Object` is optional, defaulting to defaults to `{level:\"AA\",size:\"small\"}`.\n \n+    tinycolor.isReadable(\"#000\", \"#111\", {}); // false\n+    tinycolor.isReadable(\"#ff0088\", \"#5c1a72\",{level:\"AA\",size:\"small\"}); //false\n+    tinycolor.isReadable(\"#ff0088\", \"#5c1a72\",{level:\"AA\",size:\"large\"}), //true\n+\n+#### mostReadable\n+\n+`mostReadable: function(TinyColor, [TinyColor, Tinycolor ...], Object) -> Boolean`.\n Given a base color and a list of possible foreground or background colors for that base, returns the most readable color.\n+If none of the colors in the list is readable, `mostReadable` will return the better of black or white if `checkReadability:true`.","path":"README.md","position":106,"original_position":106,"commit_id":"ec1d2a6f0ccf766c1dbd424d583cada8b6ce9741","original_commit_id":"ec1d2a6f0ccf766c1dbd424d583cada8b6ce9741","user":{"login":"bgrins","id":95570,"avatar_url":"https://avatars.githubusercontent.com/u/95570?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrins","html_url":"https://github.com/bgrins","followers_url":"https://api.github.com/users/bgrins/followers","following_url":"https://api.github.com/users/bgrins/following{/other_user}","gists_url":"https://api.github.com/users/bgrins/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrins/subscriptions","organizations_url":"https://api.github.com/users/bgrins/orgs","repos_url":"https://api.github.com/users/bgrins/repos","events_url":"https://api.github.com/users/bgrins/events{/privacy}","received_events_url":"https://api.github.com/users/bgrins/received_events","type":"User","site_admin":false},"body":"I'm not sure about this parameter name `checkReadability`, it doesn't seem to describe what it is doing.  Seems this is really about always returning an acceptable color, so maybe something like `includeFallbackColors` or `useBlackOrWhiteIfNecessary`?  Not really sure that either of those is a \"winner\", but what are your thoughts?","created_at":"2015-01-20T03:33:51Z","updated_at":"2015-01-20T03:33:51Z","html_url":"https://github.com/bgrins/TinyColor/pull/78#discussion_r23201277","pull_request_url":"https://api.github.com/repos/bgrins/TinyColor/pulls/78","_links":{"self":{"href":"https://api.github.com/repos/bgrins/TinyColor/pulls/comments/23201277"},"html":{"href":"https://github.com/bgrins/TinyColor/pull/78#discussion_r23201277"},"pull_request":{"href":"https://api.github.com/repos/bgrins/TinyColor/pulls/78"}}},"pull_request":{"url":"https://api.github.com/repos/bgrins/TinyColor/pulls/78","id":27369916,"html_url":"https://github.com/bgrins/TinyColor/pull/78","diff_url":"https://github.com/bgrins/TinyColor/pull/78.diff","patch_url":"https://github.com/bgrins/TinyColor/pull/78.patch","issue_url":"https://api.github.com/repos/bgrins/TinyColor/issues/78","number":78,"state":"open","locked":false,"title":"WCAG version 2.0 #76","user":{"login":"jladbury","id":4947792,"avatar_url":"https://avatars.githubusercontent.com/u/4947792?v=3","gravatar_id":"","url":"https://api.github.com/users/jladbury","html_url":"https://github.com/jladbury","followers_url":"https://api.github.com/users/jladbury/followers","following_url":"https://api.github.com/users/jladbury/following{/other_user}","gists_url":"https://api.github.com/users/jladbury/gists{/gist_id}","starred_url":"https://api.github.com/users/jladbury/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jladbury/subscriptions","organizations_url":"https://api.github.com/users/jladbury/orgs","repos_url":"https://api.github.com/users/jladbury/repos","events_url":"https://api.github.com/users/jladbury/events{/privacy}","received_events_url":"https://api.github.com/users/jladbury/received_events","type":"User","site_admin":false},"body":"Incorporate processing, tests and documentation for Web Content Accessibility Guidelines Version 2.0 (http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef)","created_at":"2015-01-14T18:04:37Z","updated_at":"2015-01-20T03:33:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f4f3bc8e0587f34081cff69b400d5494a4e92be","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bgrins/TinyColor/pulls/78/commits","review_comments_url":"https://api.github.com/repos/bgrins/TinyColor/pulls/78/comments","review_comment_url":"https://api.github.com/repos/bgrins/TinyColor/pulls/comments/{number}","comments_url":"https://api.github.com/repos/bgrins/TinyColor/issues/78/comments","statuses_url":"https://api.github.com/repos/bgrins/TinyColor/statuses/ec1d2a6f0ccf766c1dbd424d583cada8b6ce9741","head":{"label":"jladbury:master","ref":"master","sha":"ec1d2a6f0ccf766c1dbd424d583cada8b6ce9741","user":{"login":"jladbury","id":4947792,"avatar_url":"https://avatars.githubusercontent.com/u/4947792?v=3","gravatar_id":"","url":"https://api.github.com/users/jladbury","html_url":"https://github.com/jladbury","followers_url":"https://api.github.com/users/jladbury/followers","following_url":"https://api.github.com/users/jladbury/following{/other_user}","gists_url":"https://api.github.com/users/jladbury/gists{/gist_id}","starred_url":"https://api.github.com/users/jladbury/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jladbury/subscriptions","organizations_url":"https://api.github.com/users/jladbury/orgs","repos_url":"https://api.github.com/users/jladbury/repos","events_url":"https://api.github.com/users/jladbury/events{/privacy}","received_events_url":"https://api.github.com/users/jladbury/received_events","type":"User","site_admin":false},"repo":{"id":29139433,"name":"TinyColor","full_name":"jladbury/TinyColor","owner":{"login":"jladbury","id":4947792,"avatar_url":"https://avatars.githubusercontent.com/u/4947792?v=3","gravatar_id":"","url":"https://api.github.com/users/jladbury","html_url":"https://github.com/jladbury","followers_url":"https://api.github.com/users/jladbury/followers","following_url":"https://api.github.com/users/jladbury/following{/other_user}","gists_url":"https://api.github.com/users/jladbury/gists{/gist_id}","starred_url":"https://api.github.com/users/jladbury/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jladbury/subscriptions","organizations_url":"https://api.github.com/users/jladbury/orgs","repos_url":"https://api.github.com/users/jladbury/repos","events_url":"https://api.github.com/users/jladbury/events{/privacy}","received_events_url":"https://api.github.com/users/jladbury/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jladbury/TinyColor","description":"Fast, small color manipulation and conversion for JavaScript","fork":true,"url":"https://api.github.com/repos/jladbury/TinyColor","forks_url":"https://api.github.com/repos/jladbury/TinyColor/forks","keys_url":"https://api.github.com/repos/jladbury/TinyColor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jladbury/TinyColor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jladbury/TinyColor/teams","hooks_url":"https://api.github.com/repos/jladbury/TinyColor/hooks","issue_events_url":"https://api.github.com/repos/jladbury/TinyColor/issues/events{/number}","events_url":"https://api.github.com/repos/jladbury/TinyColor/events","assignees_url":"https://api.github.com/repos/jladbury/TinyColor/assignees{/user}","branches_url":"https://api.github.com/repos/jladbury/TinyColor/branches{/branch}","tags_url":"https://api.github.com/repos/jladbury/TinyColor/tags","blobs_url":"https://api.github.com/repos/jladbury/TinyColor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jladbury/TinyColor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jladbury/TinyColor/git/refs{/sha}","trees_url":"https://api.github.com/repos/jladbury/TinyColor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jladbury/TinyColor/statuses/{sha}","languages_url":"https://api.github.com/repos/jladbury/TinyColor/languages","stargazers_url":"https://api.github.com/repos/jladbury/TinyColor/stargazers","contributors_url":"https://api.github.com/repos/jladbury/TinyColor/contributors","subscribers_url":"https://api.github.com/repos/jladbury/TinyColor/subscribers","subscription_url":"https://api.github.com/repos/jladbury/TinyColor/subscription","commits_url":"https://api.github.com/repos/jladbury/TinyColor/commits{/sha}","git_commits_url":"https://api.github.com/repos/jladbury/TinyColor/git/commits{/sha}","comments_url":"https://api.github.com/repos/jladbury/TinyColor/comments{/number}","issue_comment_url":"https://api.github.com/repos/jladbury/TinyColor/issues/comments/{number}","contents_url":"https://api.github.com/repos/jladbury/TinyColor/contents/{+path}","compare_url":"https://api.github.com/repos/jladbury/TinyColor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jladbury/TinyColor/merges","archive_url":"https://api.github.com/repos/jladbury/TinyColor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jladbury/TinyColor/downloads","issues_url":"https://api.github.com/repos/jladbury/TinyColor/issues{/number}","pulls_url":"https://api.github.com/repos/jladbury/TinyColor/pulls{/number}","milestones_url":"https://api.github.com/repos/jladbury/TinyColor/milestones{/number}","notifications_url":"https://api.github.com/repos/jladbury/TinyColor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jladbury/TinyColor/labels{/name}","releases_url":"https://api.github.com/repos/jladbury/TinyColor/releases{/id}","created_at":"2015-01-12T14:34:17Z","updated_at":"2015-01-16T17:45:02Z","pushed_at":"2015-01-16T17:45:02Z","git_url":"git://github.com/jladbury/TinyColor.git","ssh_url":"git@github.com:jladbury/TinyColor.git","clone_url":"https://github.com/jladbury/TinyColor.git","svn_url":"https://github.com/jladbury/TinyColor","homepage":"http://bgrins.github.com/TinyColor/","size":4471,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bgrins:master","ref":"master","sha":"c32e7b068c63f5b76742c79e9f53a2a2c2bd79ba","user":{"login":"bgrins","id":95570,"avatar_url":"https://avatars.githubusercontent.com/u/95570?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrins","html_url":"https://github.com/bgrins","followers_url":"https://api.github.com/users/bgrins/followers","following_url":"https://api.github.com/users/bgrins/following{/other_user}","gists_url":"https://api.github.com/users/bgrins/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrins/subscriptions","organizations_url":"https://api.github.com/users/bgrins/orgs","repos_url":"https://api.github.com/users/bgrins/repos","events_url":"https://api.github.com/users/bgrins/events{/privacy}","received_events_url":"https://api.github.com/users/bgrins/received_events","type":"User","site_admin":false},"repo":{"id":1973790,"name":"TinyColor","full_name":"bgrins/TinyColor","owner":{"login":"bgrins","id":95570,"avatar_url":"https://avatars.githubusercontent.com/u/95570?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrins","html_url":"https://github.com/bgrins","followers_url":"https://api.github.com/users/bgrins/followers","following_url":"https://api.github.com/users/bgrins/following{/other_user}","gists_url":"https://api.github.com/users/bgrins/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrins/subscriptions","organizations_url":"https://api.github.com/users/bgrins/orgs","repos_url":"https://api.github.com/users/bgrins/repos","events_url":"https://api.github.com/users/bgrins/events{/privacy}","received_events_url":"https://api.github.com/users/bgrins/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bgrins/TinyColor","description":"Fast, small color manipulation and conversion for JavaScript","fork":false,"url":"https://api.github.com/repos/bgrins/TinyColor","forks_url":"https://api.github.com/repos/bgrins/TinyColor/forks","keys_url":"https://api.github.com/repos/bgrins/TinyColor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bgrins/TinyColor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bgrins/TinyColor/teams","hooks_url":"https://api.github.com/repos/bgrins/TinyColor/hooks","issue_events_url":"https://api.github.com/repos/bgrins/TinyColor/issues/events{/number}","events_url":"https://api.github.com/repos/bgrins/TinyColor/events","assignees_url":"https://api.github.com/repos/bgrins/TinyColor/assignees{/user}","branches_url":"https://api.github.com/repos/bgrins/TinyColor/branches{/branch}","tags_url":"https://api.github.com/repos/bgrins/TinyColor/tags","blobs_url":"https://api.github.com/repos/bgrins/TinyColor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bgrins/TinyColor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bgrins/TinyColor/git/refs{/sha}","trees_url":"https://api.github.com/repos/bgrins/TinyColor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bgrins/TinyColor/statuses/{sha}","languages_url":"https://api.github.com/repos/bgrins/TinyColor/languages","stargazers_url":"https://api.github.com/repos/bgrins/TinyColor/stargazers","contributors_url":"https://api.github.com/repos/bgrins/TinyColor/contributors","subscribers_url":"https://api.github.com/repos/bgrins/TinyColor/subscribers","subscription_url":"https://api.github.com/repos/bgrins/TinyColor/subscription","commits_url":"https://api.github.com/repos/bgrins/TinyColor/commits{/sha}","git_commits_url":"https://api.github.com/repos/bgrins/TinyColor/git/commits{/sha}","comments_url":"https://api.github.com/repos/bgrins/TinyColor/comments{/number}","issue_comment_url":"https://api.github.com/repos/bgrins/TinyColor/issues/comments/{number}","contents_url":"https://api.github.com/repos/bgrins/TinyColor/contents/{+path}","compare_url":"https://api.github.com/repos/bgrins/TinyColor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bgrins/TinyColor/merges","archive_url":"https://api.github.com/repos/bgrins/TinyColor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bgrins/TinyColor/downloads","issues_url":"https://api.github.com/repos/bgrins/TinyColor/issues{/number}","pulls_url":"https://api.github.com/repos/bgrins/TinyColor/pulls{/number}","milestones_url":"https://api.github.com/repos/bgrins/TinyColor/milestones{/number}","notifications_url":"https://api.github.com/repos/bgrins/TinyColor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bgrins/TinyColor/labels{/name}","releases_url":"https://api.github.com/repos/bgrins/TinyColor/releases{/id}","created_at":"2011-06-29T18:03:00Z","updated_at":"2015-01-20T03:16:30Z","pushed_at":"2015-01-20T03:16:55Z","git_url":"git://github.com/bgrins/TinyColor.git","ssh_url":"git@github.com:bgrins/TinyColor.git","clone_url":"https://github.com/bgrins/TinyColor.git","svn_url":"https://github.com/bgrins/TinyColor","homepage":"http://bgrins.github.com/TinyColor/","size":5198,"stargazers_count":611,"watchers_count":611,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":113,"mirror_url":null,"open_issues_count":11,"forks":113,"open_issues":11,"watchers":611,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bgrins/TinyColor/pulls/78"},"html":{"href":"https://github.com/bgrins/TinyColor/pull/78"},"issue":{"href":"https://api.github.com/repos/bgrins/TinyColor/issues/78"},"comments":{"href":"https://api.github.com/repos/bgrins/TinyColor/issues/78/comments"},"review_comments":{"href":"https://api.github.com/repos/bgrins/TinyColor/pulls/78/comments"},"review_comment":{"href":"https://api.github.com/repos/bgrins/TinyColor/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/bgrins/TinyColor/pulls/78/commits"},"statuses":{"href":"https://api.github.com/repos/bgrins/TinyColor/statuses/ec1d2a6f0ccf766c1dbd424d583cada8b6ce9741"}}}}