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

Offer both 0 centered and positive hue -> float conversion #26

Merged
merged 2 commits into from
Jan 29, 2016
Merged

Conversation

Ogeon
Copy link
Owner

@Ogeon Ogeon commented Jan 29, 2016

This is a compromise for the 0 centered vs all positive hue representation problem, where both alternatives are offered, but the current 0 centered behavior is kept as the default. The argument for this decision is that both variants are useful in different situations, and there is no obvious reason why one would be better than the other. The default is kept because it's consistent with how the trigonometric functions in libstd works. It's not the strongest reason, but it's as good as any.

Changes in this PR:

  • Rename to_float to to_degrees.
  • Add to_positive_degrees and to_positive_radians.
  • Mention the ranges in the descriptions of the conversion functions.

This is a breaking change, since it renames to_float to to_degrees. It closes #15.

@Ogeon
Copy link
Owner Author

Ogeon commented Jan 29, 2016

@homu r+

@homu
Copy link
Contributor

homu commented Jan 29, 2016

📌 Commit 275a4ee has been approved by Ogeon

@homu
Copy link
Contributor

homu commented Jan 29, 2016

⚡ Test exempted - status

@homu homu merged commit 275a4ee into master Jan 29, 2016
homu added a commit that referenced this pull request Jan 29, 2016
Offer both 0 centered and positive hue -> float conversion

This is a compromise for the 0 centered vs all positive hue representation problem, where both alternatives are offered, but the current 0 centered behavior is kept as the default. The argument for this decision is that both variants are useful in different situations, and there is no obvious reason why one would be better than the other. The default is kept because it's consistent with how the trigonometric functions in `libstd` works. It's not the strongest reason, but it's as good as any.

Changes in this PR:

 * Rename `to_float` to `to_degrees`.
 * Add `to_positive_degrees` and `to_positive_radians`.
 * Mention the ranges in the descriptions of the conversion functions.

This is a breaking change, since it renames `to_float` to `to_degrees`. It closes #15.
@Ogeon Ogeon deleted the hues branch February 15, 2016 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider converting hue types to numbers within [0, 360) instead of (-180, 180]
2 participants