Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add from_components and into_components methods to colors #87

Closed
Ogeon opened this issue Apr 3, 2018 · 0 comments
Closed

Add from_components and into_components methods to colors #87

Ogeon opened this issue Apr 3, 2018 · 0 comments
Assignees
Labels
easy / new contributor Does not require much Rust knowledge or domain knowledge
Milestone

Comments

@Ogeon
Copy link
Owner

Ogeon commented Apr 3, 2018

This would replace the old from_pixel and into_pixel methods on Rgb and it should be implemented on all color types, except for Color where it doesn't make sense. They should take/output tuples with the color components in the same order as in new.

The reason for adding them is that tuples are convenient when destructuring and also a somewhat common storage format. From<(...)> and Into<(...)> could also be implemented.

@Ogeon Ogeon added the easy / new contributor Does not require much Rust knowledge or domain knowledge label Apr 3, 2018
@Ogeon Ogeon added this to the 0.4.0 milestone Apr 3, 2018
@Ogeon Ogeon self-assigned this May 26, 2018
bors bot added a commit that referenced this issue May 26, 2018
98: Add conversion to and from component tuples r=Ogeon a=Ogeon

I took the opportunity to generalize some Alpha implementations as well.

Closes #87.

Co-authored-by: Erik Hedvall <erikwhedvall@gmail.com>
@bors bors bot closed this as completed in #98 May 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy / new contributor Does not require much Rust knowledge or domain knowledge
Projects
None yet
Development

No branches or pull requests

1 participant