Open
Conversation
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.
Adds support for "color mode", see p5 and processing.
This is a bit weird and partly legacy cruft. The key contention here is about this question of scaling, i.e. the "max" positional args. It seems, historically, this was used to switch between 8bit and 0-1 normalized color values (despite the fact that everything in Processing is 8-bit internally). However, p5 also demonstrates using it just to set an arbitrary range. I cannot for the life of me understand why / when this latter use case would be helpful, but it exists.
Internally, everything in our core just uses Bevy color which is floats.
Here's basically our current logic as expressed in this PR for a given Python method
foowhich accepts a color:foo(1.0, 1.0, 1.0, 1.0)uses the configuredColorMode, by default sRGB.foo(1.0)orfoo(1.0, 1.0)maps to grayscale and scales usingColorMode.foo(vec4(...))orfoo(vec4(..))same as above but using vec instances.foo(255, 255, 255, 255)(i.e. ints) uses the configuredColorModeand is scaled to a normalized float internally.foo(oklch(...))uses the providedColorinstance and is considered to be fully resolved, i.e. it does not observe the configured color mode.