-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Color docs should specify acceptable value ranges #17508
Labels
A-Color
Color spaces and color math
C-Docs
An addition or correction to our documentation
D-Trivial
Nice and easy! A great choice to get started with Bevy
S-Ready-For-Implementation
This issue is ready for an implementation PR. Go for it!
Comments
thebluefish
added
C-Docs
An addition or correction to our documentation
S-Needs-Triage
This issue needs to be labelled
labels
Jan 23, 2025
BenjaminBrienen
added
D-Trivial
Nice and easy! A great choice to get started with Bevy
S-Ready-For-Implementation
This issue is ready for an implementation PR. Go for it!
A-Color
Color spaces and color math
and removed
S-Needs-Triage
This issue needs to be labelled
labels
Jan 23, 2025
janis-bhm
added a commit
to janis-bhm/bevy
that referenced
this issue
Jan 29, 2025
According to bevyengine#17508, the constructors of `Color` are missing docs for the range in which the values are valid. This commit contains the least controversial docs.
janis-bhm
added a commit
to janis-bhm/bevy
that referenced
this issue
Jan 29, 2025
…7508) Fixes bevyengine#17508, accordign to which the constructors of `Color` are missing docs for the range in which the values are valid. This commit contains the least controversial docs.
janis-bhm
added a commit
to janis-bhm/bevy
that referenced
this issue
Jan 29, 2025
Partially fixes bevyengine#17508 `Color::srgba_u8()` and `Color::srgb_u8` already have doc comments that might be sufficient, but aren't in line with the underlying colour type's constructor, so I moved them into a separate commit.
janis-bhm
added a commit
to janis-bhm/bevy
that referenced
this issue
Jan 29, 2025
…7508) # Objective Fixes bevyengine#17508, according to which the constructors of `Color` are missing docs for the range in which the values are valid. This commit contains the least controversial docs.
janis-bhm
added a commit
to janis-bhm/bevy
that referenced
this issue
Jan 29, 2025
# Objective Partially fixes bevyengine#17508 `Color::srgba_u8()` and `Color::srgb_u8` already have doc comments that might be sufficient, but aren't in line with the underlying colour type's constructor, so I moved them into a separate commit.
janis-bhm
added a commit
to janis-bhm/bevy
that referenced
this issue
Jan 29, 2025
According to bevyengine#17508, the constructors of `Color` are missing docs for the range in which the values are valid. This commit contains the least controversial docs.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-Color
Color spaces and color math
C-Docs
An addition or correction to our documentation
D-Trivial
Nice and easy! A great choice to get started with Bevy
S-Ready-For-Implementation
This issue is ready for an implementation PR. Go for it!
https://docs.rs/bevy/latest/bevy/prelude/enum.Color.html
Most of the methods to construct a
Color
accept values in the range[0..1]
. A common beginner mistake is assuming the range[0..255]
. Hue is typically in the range[0..360]
. LABA/LCHA have a Lightness in the range[0..1.5]
. I might have missed some exceptions.These ranges are documented for the color-space structs being constructed by each method, but IMO should be documented in the method, too.
The text was updated successfully, but these errors were encountered: