{"action":"created","issue":{"url":"https://api.github.com/repos/bjz/color-rs/issues/30","labels_url":"https://api.github.com/repos/bjz/color-rs/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/bjz/color-rs/issues/30/comments","events_url":"https://api.github.com/repos/bjz/color-rs/issues/30/events","html_url":"https://github.com/bjz/color-rs/pull/30","id":71956167,"number":30,"title":"Several refactorings and additions:","user":{"login":"arturoc","id":48240,"avatar_url":"https://avatars.githubusercontent.com/u/48240?v=3","gravatar_id":"","url":"https://api.github.com/users/arturoc","html_url":"https://github.com/arturoc","followers_url":"https://api.github.com/users/arturoc/followers","following_url":"https://api.github.com/users/arturoc/following{/other_user}","gists_url":"https://api.github.com/users/arturoc/gists{/gist_id}","starred_url":"https://api.github.com/users/arturoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arturoc/subscriptions","organizations_url":"https://api.github.com/users/arturoc/orgs","repos_url":"https://api.github.com/users/arturoc/repos","events_url":"https://api.github.com/users/arturoc/events{/privacy}","received_events_url":"https://api.github.com/users/arturoc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-29T18:49:38Z","updated_at":"2015-05-04T14:19:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bjz/color-rs/pulls/30","html_url":"https://github.com/bjz/color-rs/pull/30","diff_url":"https://github.com/bjz/color-rs/pull/30.diff","patch_url":"https://github.com/bjz/color-rs/pull/30.patch"},"body":"I've been using this library for a while and kept adding several changes i needed but never send you a PR. Not sure if it's in line with the idea you have for the library though, so just let me know if you don't think so.\r\n\r\nHere's a changelog:\r\n\r\n+ Added `ToRgba`\r\n+ Removed `Color3` and `Color4` in favor of `AsRef`, `AsMut`, `Index` and `IndexMut`\r\n+ Refactored HSV (mostly ToRgb) to work with non floats too\r\n+  Use [angle-rs](https://github.com/arturoc/angle-rs) to express Hue as angle and delegate there the angle math (some things like the wrapping of the angle wasn't totally correct)\r\n+ Removed normalize-degrees and invert-degrees\r\n+ Changed normalize-channel to saturate, since normalize seems to indicate that is normalized in relation to something as opposed to just clamped to the limits of the range. Saturate is also the usual term in glsl and hlsl\r\n+ Changed `FloatColor::normalize()` to `FloatColor::saturate()`\r\n+ Added `Channel` and `Color` `mix()`\r\n+ Impl arithmetic operators traits for `Rgb` and `Rgba`. Work like GLSL\r\n+ Added `Channel::normalized_mul` and `div` which cast to f32, do the multiplication and cast back to the original type so operators and mix over int colors make sense. eg: WHITE * RED == RED (there might be a way to do this with int math but haven't looked into it yet)\r\n+ Removed clamp hue from clamp HSV, didn't make sense since SV are 1..0\r\n  and H 0..360\r\n+ Impl `num::Saturate` trait for `Rgb` and `Rgba` so int colors can be added or\r\n  subtracted saturating at the limits\r\n+ Added `Channel::max()` that returns `type::MAX` for int types or 1.0 for\r\n  floats\r\n+ Added glsl style swizzles for Rgb and Rgba. eg: color.bgra()\r\n+ Added `rgb!` and `rgba!` macros so creating those types is less verbose\r\n+ Impl `ToRgb` for u32 so it can be used for hex colors. eg: `0xFF0000.to_rgb()`"},"comment":{"url":"https://api.github.com/repos/bjz/color-rs/issues/comments/98724924","html_url":"https://github.com/bjz/color-rs/pull/30#issuecomment-98724924","issue_url":"https://api.github.com/repos/bjz/color-rs/issues/30","id":98724924,"user":{"login":"arturoc","id":48240,"avatar_url":"https://avatars.githubusercontent.com/u/48240?v=3","gravatar_id":"","url":"https://api.github.com/users/arturoc","html_url":"https://github.com/arturoc","followers_url":"https://api.github.com/users/arturoc/followers","following_url":"https://api.github.com/users/arturoc/following{/other_user}","gists_url":"https://api.github.com/users/arturoc/gists{/gist_id}","starred_url":"https://api.github.com/users/arturoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arturoc/subscriptions","organizations_url":"https://api.github.com/users/arturoc/orgs","repos_url":"https://api.github.com/users/arturoc/repos","events_url":"https://api.github.com/users/arturoc/events{/privacy}","received_events_url":"https://api.github.com/users/arturoc/received_events","type":"User","site_admin":false},"created_at":"2015-05-04T14:19:06Z","updated_at":"2015-05-04T14:19:06Z","body":"sure, no worries : )   \r\n\r\ni think that last commit should fix everything but let me know if you find something else"}}