{"action":"created","issue":{"url":"https://api.github.com/repos/Ogeon/palette/issues/48","repository_url":"https://api.github.com/repos/Ogeon/palette","labels_url":"https://api.github.com/repos/Ogeon/palette/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/Ogeon/palette/issues/48/comments","events_url":"https://api.github.com/repos/Ogeon/palette/issues/48/events","html_url":"https://github.com/Ogeon/palette/pull/48","id":133159482,"number":48,"title":"Add tests for conversions","user":{"login":"sidred","id":6623285,"avatar_url":"https://avatars.githubusercontent.com/u/6623285?v=3","gravatar_id":"","url":"https://api.github.com/users/sidred","html_url":"https://github.com/sidred","followers_url":"https://api.github.com/users/sidred/followers","following_url":"https://api.github.com/users/sidred/following{/other_user}","gists_url":"https://api.github.com/users/sidred/gists{/gist_id}","starred_url":"https://api.github.com/users/sidred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sidred/subscriptions","organizations_url":"https://api.github.com/users/sidred/orgs","repos_url":"https://api.github.com/users/sidred/repos","events_url":"https://api.github.com/users/sidred/events{/privacy}","received_events_url":"https://api.github.com/users/sidred/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":27,"created_at":"2016-02-12T05:14:46Z","updated_at":"2016-02-13T16:35:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Ogeon/palette/pulls/48","html_url":"https://github.com/Ogeon/palette/pull/48","diff_url":"https://github.com/Ogeon/palette/pull/48.diff","patch_url":"https://github.com/Ogeon/palette/pull/48.patch"},"body":"Add conversion tests. Test data is from Cie Illuminants data (for Xyz <-> Yxy conversion tests) and colormine.org (more comprehensive conversions).\r\n\r\nCloses #44.\r\n\r\n### Changes\r\n- Xyz -> Yxy conversion changed to use x:0 and y:0 as default when Y = 0 from the earlier D65 white point values\r\n- There are a few different formula's for Xyz <-> Lab conversions, each slightly different. Formulas updated to use the [CIE Technical Report Colorimetry 3rd Edition](https://law.resource.org/pub/us/cfr/ibr/003/cie.15.2004.pdf). \r\n- Hsl and Hsv conversions updated to avoid divide by zero issues.\r\n\r\n### Notes\r\n- Conversion tested for an accuracy of 0.05. This is to validate that the values are close enough.\r\n- ColorMine Linearizes the Rgb values before conversions, so rgb, hsl and hsv conversions are separately tested from xyz, yxy, lab and lch. \r\n- ColorMine formula for Lch hue seems incorrect. Ex Gray (128,128,128) gives a Lch Hue of 296 when the value is expected to be 0. So ignored the Lch hue comparisons.\r\n- The full test of ColorMine colors does not currently pass. Only the mini verision with common colors passes. Cannot reconcile the Rgb <-> Lab converions in ColorMine with other calculators online. See the Blue Voilet color for an example with the conversion issue."},"comment":{"url":"https://api.github.com/repos/Ogeon/palette/issues/comments/183699963","html_url":"https://github.com/Ogeon/palette/pull/48#issuecomment-183699963","issue_url":"https://api.github.com/repos/Ogeon/palette/issues/48","id":183699963,"user":{"login":"Ogeon","id":225229,"avatar_url":"https://avatars.githubusercontent.com/u/225229?v=3","gravatar_id":"","url":"https://api.github.com/users/Ogeon","html_url":"https://github.com/Ogeon","followers_url":"https://api.github.com/users/Ogeon/followers","following_url":"https://api.github.com/users/Ogeon/following{/other_user}","gists_url":"https://api.github.com/users/Ogeon/gists{/gist_id}","starred_url":"https://api.github.com/users/Ogeon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ogeon/subscriptions","organizations_url":"https://api.github.com/users/Ogeon/orgs","repos_url":"https://api.github.com/users/Ogeon/repos","events_url":"https://api.github.com/users/Ogeon/events{/privacy}","received_events_url":"https://api.github.com/users/Ogeon/received_events","type":"User","site_admin":false},"created_at":"2016-02-13T16:35:42Z","updated_at":"2016-02-13T16:35:42Z","body":"Something is not right, here. a in Lab differs by 0.012, which seems like quite a bit, and Lch chroma differs by 0.01. The differences in hue is in degrees, so I doubt it's relate to pi, but what do I know? It's still quite some difference. atan2 shouldn't be _that_ inaccurate. Could it be some typo in the reverse conversion?"}}