Open
Conversation
catilac
approved these changes
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #21
Adds a new Python
Colorclass that wrapsbevy_color.A
Coloris an opaque wrapper around a given color space representation. Bevy's color APIs will handle conversions internally as needed and users are expected to know which color space they're working in. Note, everything eventually gets reduces to linear rgba in the shader, but this allows us to be maximally flexible in terms of our high level API.This is similar to the work done for #91 in that we accept a variety of ways to construct a color:
color(1.0, 1.0, 1.0)orcolor(1.0, 1.0, 1.0, 1.0). This will produce a sRGBA color"#FFFFFFFFwhich will also produce a sRGBA color.oklch(1.0, 1.0, 1.0, 1.0);Vec3/Vec4: color(vec4(1.0, 1.0, 1.0, 1.0)). Will also produce a sRGBA color. Less useful but potential helpful for doing weird things like position to color.We also expose a variety of helpful methods from bevy like
lerpandmix.N.B.:
#[pyo3(signature = (r, g, b, a=1.0))]allows for omitting the alpha positional arg in Python, so users can use either the 3 arg or 4 arg versions.