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

Implement the assign operators for color, alpha and hue types #94

Closed
Ogeon opened this issue Apr 29, 2018 · 4 comments
Closed

Implement the assign operators for color, alpha and hue types #94

Ogeon opened this issue Apr 29, 2018 · 4 comments
Labels
easy / new contributor Does not require much Rust knowledge or domain knowledge

Comments

@Ogeon
Copy link
Owner

Ogeon commented Apr 29, 2018

Implement AddAssign, SubAssign, MulAssign, DivAssign for the color types, alpha types and hue types. It may be possible to either base them on the current arithmetic operators or base the current ones on the assign operators. All the colors are Copy, so I don't know if it matters which way it is.

@Ogeon Ogeon added the easy / new contributor Does not require much Rust knowledge or domain knowledge label Apr 29, 2018
@Ogeon Ogeon changed the title Implement the assign operators for color types Implement the assign operators for color, alpha and hue types Apr 29, 2018
@Ogeon Ogeon added this to the 0.4.1 milestone Jul 10, 2018
@Veykril
Copy link
Contributor

Veykril commented Sep 18, 2018

I'm currently working on this and noticed that all the arithmetic is only implemented on the Linear Transfer Fn, is it only possible to do standard arithmetic on these or are the others just not implemented yet?

@Ogeon
Copy link
Owner Author

Ogeon commented Sep 18, 2018

Nice! It's very much by design, because part of the point of this library is to encourage (or enforce) a linear workflow. Using non-linear colors introduces an error that can be quite noticeable in some cases. I should make that more clear in the description at some point, but here's a simple illustration: https://ninedegreesbelow.com/photography/gimp/patched/soft-dots-compared.jpg

@Veykril
Copy link
Contributor

Veykril commented Sep 18, 2018

Ah yes, that makes sense then okay. On another note, I wont implement the assign ops by basing them on the non assign ones cause that would force a generic constraint of the non-assign op on the T: Component part, if you can follow me, which in theory should work if I were to do this but it doesnt look that great in my opinion(Same applies the other way around ofc).

@Ogeon
Copy link
Owner Author

Ogeon commented Sep 18, 2018

It was just a suggestion, based on a guess. Considering that one implies the other, it kind of make sense, but it's an unnecessary constraint as you said. Go with your plan! 👍

bors bot added a commit that referenced this issue Sep 18, 2018
118: Implement assign ops r=Ogeon a=Veykril

Closes #94.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
bors bot added a commit that referenced this issue Sep 18, 2018
118: Implement assign ops r=Ogeon a=Veykril

Closes #94.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
@bors bors bot closed this as completed in #118 Sep 18, 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

2 participants