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 doc alias, doc cleanups, remove trait from Packed struct #216

Merged
merged 1 commit into from Apr 13, 2021

Conversation

okaneco
Copy link
Contributor

@okaneco okaneco commented Apr 11, 2021

Add "hsb" alias for Hsv
Add "linear" for LinLuma/a and LinSrgb/a
Add "wcag" for RelativeContrast trait
Add "xyY" for Yxy
Add "gray/grey" for Luma
Make rgb::FromHexError public and document it
Clean up document example in RelativeContrast
Remove RgbChannels trait from Packed struct

Add "hsb" alias for Hsv
Add "linear" for LinLuma/a and LinSrgb/a
Add "wcag" for RelativeContrast trait
Add "xyY" for Yxy
Add "gray/grey" for Luma
Make rgb::FromHexError public and document it
Clean up document example in RelativeContrast
Remove RgbChannels trait from Packed struct
@okaneco
Copy link
Contributor Author

okaneco commented Apr 11, 2021

I added a few doc aliases that seemed appropriate and did some small fixups in docs. The aliases make searching a bit more ergonomic. The search is surprisingly fuzzy but also doesn't surface as much as I'd probably want based on the documentation text.

I know people can tend to copy/paste code straight from docs so I wanted to change the relative contrast example to show From<u32> exists on Srgb instead of having to convert from a string -- this was written before that impl existed. In the process, I realized that the error wasn't available outside of the crate so I think it should be made pub since that's what is returned in from_str.

Comment on lines +27 to +29
/// let unpacked: Srgba<u8> = Packed::<Rgba>::from(0xFFFF_FF80).into();
/// assert_relative_eq!(
/// Srgba::new(0.5, 1.0, 1.0, 0.5),
/// Srgba::new(1.0, 1.0, 1.0, 0.5),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just want to say that I appreciate that you spotted this. Nice to remove the ambiguity!

@Ogeon
Copy link
Owner

Ogeon commented Apr 13, 2021

This is a good set of aliases and some nice cleanup! Thank you!

bors r+

@bors
Copy link
Contributor

bors bot commented Apr 13, 2021

Build succeeded:

@bors bors bot merged commit acc80ca into Ogeon:master Apr 13, 2021
@okaneco okaneco deleted the doc-aliases branch April 13, 2021 18:42
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.

None yet

2 participants