{"action":"created","issue":{"url":"https://api.github.com/repos/Ogeon/palette/issues/8","labels_url":"https://api.github.com/repos/Ogeon/palette/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/Ogeon/palette/issues/8/comments","events_url":"https://api.github.com/repos/Ogeon/palette/issues/8/events","html_url":"https://github.com/Ogeon/palette/issues/8","id":126218766,"number":8,"title":"xyz -> lab conversion","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":[{"url":"https://api.github.com/repos/Ogeon/palette/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-01-12T16:34:37Z","updated_at":"2016-01-12T21:18:18Z","closed_at":null,"body":"Hey I just started working on a similar library [repo](https://github.com/sidred/color_space).\r\n\r\nI noticed your cie -> lab conversion does follow [wikipedia](https://en.wikipedia.org/wiki/Lab_color_space) or http://www.brucelindbloom.com/index.html?ColorCalculator.html which I used as reference. What is your source for the conversions formulas?\r\n\r\n[link](https://github.com/sidred/color_space/blob/master/src/color_space/cie.rs#L164) to the conversion I implemented for reference. "},"comment":{"url":"https://api.github.com/repos/Ogeon/palette/issues/comments/171057705","html_url":"https://github.com/Ogeon/palette/issues/8#issuecomment-171057705","issue_url":"https://api.github.com/repos/Ogeon/palette/issues/8","id":171057705,"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-01-12T21:18:18Z","updated_at":"2016-01-12T21:18:18Z","body":"1) I would still prefer a solution with generics if the type is the only difference. It gives the users more freedom and makes it easier for other libraries to extend them. We can set either `f32` or `f64` as the default type to keep it as ergonomic as possible. The messy calculations will not affect the users unless they make their code generic as well, but that's expected.\r\n\r\n2) The illuminants could perhaps be types that implements some `Illuminant` trait. That would allow compile time rejection of some illuminants. It would become more verbose, on the other hand. I think it may have to be prototyped to really know.\r\n\r\n3) I'm, once again, reluctant when it comes to having two subtle variants of the same type. That's why I included alpha in the first place. The alpha component is usually not used in calculations, except blending, so bolting it on with a wrapper type doesn't sound too bad, after all.\r\n\r\n5) That is the thought with #7. An enum isn't really appropriate in this case, since the spaces should be allowed to have different properties.\r\n\r\n6) Yes, that's a good idea. Note that the hue types behaves in a cyclic way, so -180 is treated as equal to 180. Only the external representation needs to change. E.g. when converted to `f32` or when printed through `Display`."}}