{"action":"created","comment":{"url":"https://api.github.com/repos/supersimple/chameleon/pulls/comments/190700895","pull_request_review_id":123134633,"id":190700895,"diff_hunk":"@@ -0,0 +1,47 @@\n+defmodule HSVTest do\n+  use ExUnit.Case\n+  alias Chameleon.{RGB, HSV}\n+\n+  doctest Chameleon.HSV\n+\n+  def rgb_to_hsv_pairs() do\n+    [\n+      {RGB.new(0, 0, 0), HSV.new(0, 0, 0)},\n+      {RGB.new(255, 255, 255), HSV.new(0, 0, 100)},\n+      {RGB.new(255, 0, 0), HSV.new(0, 100, 100)},\n+      {RGB.new(0, 255, 0), HSV.new(120, 100, 100)},\n+      {RGB.new(0, 0, 255), HSV.new(240, 100, 100)},\n+      {RGB.new(255, 255, 0), HSV.new(60, 100, 100)},\n+      {RGB.new(0, 255, 255), HSV.new(180, 100, 100)},\n+      {RGB.new(255, 0, 255), HSV.new(300, 100, 100)},\n+      {RGB.new(191, 191, 191), HSV.new(0, 0, 75)},\n+      {RGB.new(128, 128, 128), HSV.new(0, 0, 50)},\n+      {RGB.new(128, 0, 0), HSV.new(0, 100, 50)},\n+      {RGB.new(128, 128, 0), HSV.new(60, 100, 50)},\n+      {RGB.new(0, 128, 0), HSV.new(120, 100, 50)},\n+      {RGB.new(128, 0, 128), HSV.new(300, 100, 50)},\n+      {RGB.new(0, 128, 128), HSV.new(180, 100, 50)},\n+      {RGB.new(0, 0, 128), HSV.new(240, 100, 50)}\n+    ]\n+  end\n+\n+  test \"converts from HSV to RGB\" do\n+    for {rgb, hsv} <- rgb_to_hsv_pairs() do\n+      assert rgb == Chameleon.convert(hsv, RGB)\n+    end\n+  end\n+\n+  test \"converts from RGB to HSV\" do\n+    for {rgb, hsv} <- rgb_to_hsv_pairs() do\n+      assert hsv == Chameleon.convert(rgb, HSV)\n+    end\n+  end\n+\n+  test \"converts from keyword to HSV\" do\n+    # Fails since \"black\" isn't RGB 0, 0, 0\n+    # assert HSV.new(0, 0, 0) == Chameleon.convert(\"black\", HSV)","path":"test/hsv_test.exs","position":42,"original_position":42,"commit_id":"4112d198f917323939d1e2f8457cfc7d2dfc69aa","original_commit_id":"4112d198f917323939d1e2f8457cfc7d2dfc69aa","user":{"login":"supersimple","id":773380,"avatar_url":"https://avatars0.githubusercontent.com/u/773380?v=4","gravatar_id":"","url":"https://api.github.com/users/supersimple","html_url":"https://github.com/supersimple","followers_url":"https://api.github.com/users/supersimple/followers","following_url":"https://api.github.com/users/supersimple/following{/other_user}","gists_url":"https://api.github.com/users/supersimple/gists{/gist_id}","starred_url":"https://api.github.com/users/supersimple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supersimple/subscriptions","organizations_url":"https://api.github.com/users/supersimple/orgs","repos_url":"https://api.github.com/users/supersimple/repos","events_url":"https://api.github.com/users/supersimple/events{/privacy}","received_events_url":"https://api.github.com/users/supersimple/received_events","type":"User","site_admin":false},"body":"true black is actually the pantone value \"30\" ¯\\_(ツ)_/¯","created_at":"2018-05-24T19:14:45Z","updated_at":"2018-05-24T19:14:45Z","html_url":"https://github.com/supersimple/chameleon/pull/2#discussion_r190700895","pull_request_url":"https://api.github.com/repos/supersimple/chameleon/pulls/2","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/supersimple/chameleon/pulls/comments/190700895"},"html":{"href":"https://github.com/supersimple/chameleon/pull/2#discussion_r190700895"},"pull_request":{"href":"https://api.github.com/repos/supersimple/chameleon/pulls/2"}},"in_reply_to_id":190688180},"pull_request":{"url":"https://api.github.com/repos/supersimple/chameleon/pulls/2","id":189228821,"html_url":"https://github.com/supersimple/chameleon/pull/2","diff_url":"https://github.com/supersimple/chameleon/pull/2.diff","patch_url":"https://github.com/supersimple/chameleon/pull/2.patch","issue_url":"https://api.github.com/repos/supersimple/chameleon/issues/2","number":2,"state":"open","locked":false,"title":"Add the HSV colorspace","user":{"login":"fhunleth","id":64669,"avatar_url":"https://avatars0.githubusercontent.com/u/64669?v=4","gravatar_id":"","url":"https://api.github.com/users/fhunleth","html_url":"https://github.com/fhunleth","followers_url":"https://api.github.com/users/fhunleth/followers","following_url":"https://api.github.com/users/fhunleth/following{/other_user}","gists_url":"https://api.github.com/users/fhunleth/gists{/gist_id}","starred_url":"https://api.github.com/users/fhunleth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fhunleth/subscriptions","organizations_url":"https://api.github.com/users/fhunleth/orgs","repos_url":"https://api.github.com/users/fhunleth/repos","events_url":"https://api.github.com/users/fhunleth/events{/privacy}","received_events_url":"https://api.github.com/users/fhunleth/received_events","type":"User","site_admin":false},"body":"This adds the HSV colorspace. I had mistakenly thought that HSL would be close enough, but that didn't work out.\r\n\r\nA few notes on this PR. I think these are all food for thought or for future PRs:\r\n\r\n1. I added the `percent()` and `angle()` types for this module. They probably should be refactored to a common location when they get used by other modules.\r\n2. I wonder if floating point values should be allowed. I didn't make this change since it would be inconsistent with other colors, but the restriction to use integers felt arbitrary.\r\n3. I separated out the HSV tests from the others since I wanted to unit test it against more colors and it felt too much for one test file. I think it would be nice to have a `_test.exs` for each supported color.\r\n4. I found out that \"black\" converts using Pantone black which is not RGB(0, 0, 0). I found this surprising. Since I don't use Pantone colors, I wasn't sure whether you'd find this surprising so I just commented out the test.\r\n\r\n","created_at":"2018-05-20T10:55:52Z","updated_at":"2018-05-24T19:14:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5a26a3b2f85b25bf14509a713a58a26270919b4b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/supersimple/chameleon/pulls/2/commits","review_comments_url":"https://api.github.com/repos/supersimple/chameleon/pulls/2/comments","review_comment_url":"https://api.github.com/repos/supersimple/chameleon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/supersimple/chameleon/issues/2/comments","statuses_url":"https://api.github.com/repos/supersimple/chameleon/statuses/4112d198f917323939d1e2f8457cfc7d2dfc69aa","head":{"label":"fhunleth:hsv","ref":"hsv","sha":"4112d198f917323939d1e2f8457cfc7d2dfc69aa","user":{"login":"fhunleth","id":64669,"avatar_url":"https://avatars0.githubusercontent.com/u/64669?v=4","gravatar_id":"","url":"https://api.github.com/users/fhunleth","html_url":"https://github.com/fhunleth","followers_url":"https://api.github.com/users/fhunleth/followers","following_url":"https://api.github.com/users/fhunleth/following{/other_user}","gists_url":"https://api.github.com/users/fhunleth/gists{/gist_id}","starred_url":"https://api.github.com/users/fhunleth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fhunleth/subscriptions","organizations_url":"https://api.github.com/users/fhunleth/orgs","repos_url":"https://api.github.com/users/fhunleth/repos","events_url":"https://api.github.com/users/fhunleth/events{/privacy}","received_events_url":"https://api.github.com/users/fhunleth/received_events","type":"User","site_admin":false},"repo":{"id":134141550,"name":"chameleon","full_name":"fhunleth/chameleon","owner":{"login":"fhunleth","id":64669,"avatar_url":"https://avatars0.githubusercontent.com/u/64669?v=4","gravatar_id":"","url":"https://api.github.com/users/fhunleth","html_url":"https://github.com/fhunleth","followers_url":"https://api.github.com/users/fhunleth/followers","following_url":"https://api.github.com/users/fhunleth/following{/other_user}","gists_url":"https://api.github.com/users/fhunleth/gists{/gist_id}","starred_url":"https://api.github.com/users/fhunleth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fhunleth/subscriptions","organizations_url":"https://api.github.com/users/fhunleth/orgs","repos_url":"https://api.github.com/users/fhunleth/repos","events_url":"https://api.github.com/users/fhunleth/events{/privacy}","received_events_url":"https://api.github.com/users/fhunleth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fhunleth/chameleon","description":"Chameleon Hex Package","fork":true,"url":"https://api.github.com/repos/fhunleth/chameleon","forks_url":"https://api.github.com/repos/fhunleth/chameleon/forks","keys_url":"https://api.github.com/repos/fhunleth/chameleon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fhunleth/chameleon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fhunleth/chameleon/teams","hooks_url":"https://api.github.com/repos/fhunleth/chameleon/hooks","issue_events_url":"https://api.github.com/repos/fhunleth/chameleon/issues/events{/number}","events_url":"https://api.github.com/repos/fhunleth/chameleon/events","assignees_url":"https://api.github.com/repos/fhunleth/chameleon/assignees{/user}","branches_url":"https://api.github.com/repos/fhunleth/chameleon/branches{/branch}","tags_url":"https://api.github.com/repos/fhunleth/chameleon/tags","blobs_url":"https://api.github.com/repos/fhunleth/chameleon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fhunleth/chameleon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fhunleth/chameleon/git/refs{/sha}","trees_url":"https://api.github.com/repos/fhunleth/chameleon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fhunleth/chameleon/statuses/{sha}","languages_url":"https://api.github.com/repos/fhunleth/chameleon/languages","stargazers_url":"https://api.github.com/repos/fhunleth/chameleon/stargazers","contributors_url":"https://api.github.com/repos/fhunleth/chameleon/contributors","subscribers_url":"https://api.github.com/repos/fhunleth/chameleon/subscribers","subscription_url":"https://api.github.com/repos/fhunleth/chameleon/subscription","commits_url":"https://api.github.com/repos/fhunleth/chameleon/commits{/sha}","git_commits_url":"https://api.github.com/repos/fhunleth/chameleon/git/commits{/sha}","comments_url":"https://api.github.com/repos/fhunleth/chameleon/comments{/number}","issue_comment_url":"https://api.github.com/repos/fhunleth/chameleon/issues/comments{/number}","contents_url":"https://api.github.com/repos/fhunleth/chameleon/contents/{+path}","compare_url":"https://api.github.com/repos/fhunleth/chameleon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fhunleth/chameleon/merges","archive_url":"https://api.github.com/repos/fhunleth/chameleon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fhunleth/chameleon/downloads","issues_url":"https://api.github.com/repos/fhunleth/chameleon/issues{/number}","pulls_url":"https://api.github.com/repos/fhunleth/chameleon/pulls{/number}","milestones_url":"https://api.github.com/repos/fhunleth/chameleon/milestones{/number}","notifications_url":"https://api.github.com/repos/fhunleth/chameleon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fhunleth/chameleon/labels{/name}","releases_url":"https://api.github.com/repos/fhunleth/chameleon/releases{/id}","deployments_url":"https://api.github.com/repos/fhunleth/chameleon/deployments","created_at":"2018-05-20T10:39:59Z","updated_at":"2018-05-20T10:40:01Z","pushed_at":"2018-05-20T11:06:51Z","git_url":"git://github.com/fhunleth/chameleon.git","ssh_url":"git@github.com:fhunleth/chameleon.git","clone_url":"https://github.com/fhunleth/chameleon.git","svn_url":"https://github.com/fhunleth/chameleon","homepage":null,"size":793,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"supersimple:v2","ref":"v2","sha":"c904f478b7374793ea72784db9cde1d6d2bc0bb7","user":{"login":"supersimple","id":773380,"avatar_url":"https://avatars0.githubusercontent.com/u/773380?v=4","gravatar_id":"","url":"https://api.github.com/users/supersimple","html_url":"https://github.com/supersimple","followers_url":"https://api.github.com/users/supersimple/followers","following_url":"https://api.github.com/users/supersimple/following{/other_user}","gists_url":"https://api.github.com/users/supersimple/gists{/gist_id}","starred_url":"https://api.github.com/users/supersimple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supersimple/subscriptions","organizations_url":"https://api.github.com/users/supersimple/orgs","repos_url":"https://api.github.com/users/supersimple/repos","events_url":"https://api.github.com/users/supersimple/events{/privacy}","received_events_url":"https://api.github.com/users/supersimple/received_events","type":"User","site_admin":false},"repo":{"id":108355424,"name":"chameleon","full_name":"supersimple/chameleon","owner":{"login":"supersimple","id":773380,"avatar_url":"https://avatars0.githubusercontent.com/u/773380?v=4","gravatar_id":"","url":"https://api.github.com/users/supersimple","html_url":"https://github.com/supersimple","followers_url":"https://api.github.com/users/supersimple/followers","following_url":"https://api.github.com/users/supersimple/following{/other_user}","gists_url":"https://api.github.com/users/supersimple/gists{/gist_id}","starred_url":"https://api.github.com/users/supersimple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supersimple/subscriptions","organizations_url":"https://api.github.com/users/supersimple/orgs","repos_url":"https://api.github.com/users/supersimple/repos","events_url":"https://api.github.com/users/supersimple/events{/privacy}","received_events_url":"https://api.github.com/users/supersimple/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/supersimple/chameleon","description":"Chameleon Hex Package","fork":false,"url":"https://api.github.com/repos/supersimple/chameleon","forks_url":"https://api.github.com/repos/supersimple/chameleon/forks","keys_url":"https://api.github.com/repos/supersimple/chameleon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/supersimple/chameleon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/supersimple/chameleon/teams","hooks_url":"https://api.github.com/repos/supersimple/chameleon/hooks","issue_events_url":"https://api.github.com/repos/supersimple/chameleon/issues/events{/number}","events_url":"https://api.github.com/repos/supersimple/chameleon/events","assignees_url":"https://api.github.com/repos/supersimple/chameleon/assignees{/user}","branches_url":"https://api.github.com/repos/supersimple/chameleon/branches{/branch}","tags_url":"https://api.github.com/repos/supersimple/chameleon/tags","blobs_url":"https://api.github.com/repos/supersimple/chameleon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/supersimple/chameleon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/supersimple/chameleon/git/refs{/sha}","trees_url":"https://api.github.com/repos/supersimple/chameleon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/supersimple/chameleon/statuses/{sha}","languages_url":"https://api.github.com/repos/supersimple/chameleon/languages","stargazers_url":"https://api.github.com/repos/supersimple/chameleon/stargazers","contributors_url":"https://api.github.com/repos/supersimple/chameleon/contributors","subscribers_url":"https://api.github.com/repos/supersimple/chameleon/subscribers","subscription_url":"https://api.github.com/repos/supersimple/chameleon/subscription","commits_url":"https://api.github.com/repos/supersimple/chameleon/commits{/sha}","git_commits_url":"https://api.github.com/repos/supersimple/chameleon/git/commits{/sha}","comments_url":"https://api.github.com/repos/supersimple/chameleon/comments{/number}","issue_comment_url":"https://api.github.com/repos/supersimple/chameleon/issues/comments{/number}","contents_url":"https://api.github.com/repos/supersimple/chameleon/contents/{+path}","compare_url":"https://api.github.com/repos/supersimple/chameleon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/supersimple/chameleon/merges","archive_url":"https://api.github.com/repos/supersimple/chameleon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/supersimple/chameleon/downloads","issues_url":"https://api.github.com/repos/supersimple/chameleon/issues{/number}","pulls_url":"https://api.github.com/repos/supersimple/chameleon/pulls{/number}","milestones_url":"https://api.github.com/repos/supersimple/chameleon/milestones{/number}","notifications_url":"https://api.github.com/repos/supersimple/chameleon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/supersimple/chameleon/labels{/name}","releases_url":"https://api.github.com/repos/supersimple/chameleon/releases{/id}","deployments_url":"https://api.github.com/repos/supersimple/chameleon/deployments","created_at":"2017-10-26T03:12:03Z","updated_at":"2018-05-24T19:14:25Z","pushed_at":"2018-05-24T15:53:07Z","git_url":"git://github.com/supersimple/chameleon.git","ssh_url":"git@github.com:supersimple/chameleon.git","clone_url":"https://github.com/supersimple/chameleon.git","svn_url":"https://github.com/supersimple/chameleon","homepage":null,"size":791,"stargazers_count":1,"watchers_count":1,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":1,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/supersimple/chameleon/pulls/2"},"html":{"href":"https://github.com/supersimple/chameleon/pull/2"},"issue":{"href":"https://api.github.com/repos/supersimple/chameleon/issues/2"},"comments":{"href":"https://api.github.com/repos/supersimple/chameleon/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/supersimple/chameleon/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/supersimple/chameleon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/supersimple/chameleon/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/supersimple/chameleon/statuses/4112d198f917323939d1e2f8457cfc7d2dfc69aa"}},"author_association":"NONE"}}
{"actor":{"display_login":"supersimple"}}