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 Color::rgb_u8 and Color::rgba_u8 #381

Merged
merged 1 commit into from
Aug 28, 2020
Merged

Add Color::rgb_u8 and Color::rgba_u8 #381

merged 1 commit into from
Aug 28, 2020

Conversation

dallenng
Copy link
Contributor

Allows to create colors from u8.
Resolve #364

@karroffel karroffel added C-Code-Quality A section of code that is hard to understand or change A-Rendering Drawing game state to the screen labels Aug 28, 2020
@@ -37,6 +37,21 @@ impl Color {
pub const fn rgba(r: f32, g: f32, b: f32, a: f32) -> Color {
Copy link
Member

Choose a reason for hiding this comment

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

I think we could do with some doc comments on Color and its associated functions about being normalised values.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah i think that probably makes sense, both on the Color struct and on functions taking floats (rgba/rgb). Probably should be a separate PR though. Feel free to create one (or an issue to track it).

@cart
Copy link
Member

cart commented Aug 28, 2020

Looks good. Thanks!

@cart cart merged commit d64882f into bevyengine:master Aug 28, 2020
@dallenng dallenng deleted the color_u8 branch August 31, 2020 12:12
mrk-its pushed a commit to mrk-its/bevy that referenced this pull request Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why does Color::rgb use f32 instead of u8?
4 participants