You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains 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
The Blend trait has been split into Compose, Blend and BlendWith, to allow more color spaces to be composed. The trait implementations were also changed from a default implementation to blanket implementations. Having blanket implementations allows users to only require the trait to be implemented without having to specify the trait's requirements. For example, it's only required to specify where C: Blend instead of listing all the mathematical requirements.
The PreAlpha type has also been changed a lot to get rid of the alpha type parameter and to leave premultiplication to the color types. A lot of it was developed in tandem with changing how the blending was implemented to make those implementations make more sense.
The Blend trait, the PreAlpha type and a lot of associated API has been changed. Most users should not notice too much, except for needing a different trait or getting it from the blend module. The ComponentWise trait is also gone, since all colors can be cast to arrays for iteration
MSRV is changed to 1.55.0 to be able to use [T; N]::map.
This is what I have been up to for the past few weeks. At least to and from. There is still room for improvement but it should at least be more useful and less confusing than before. And the examples helps with verifying the implementation. Note, when looking at them, that they use linear colors. Many applications will not do that, so they may differ a bit. I'm considering allowing any RGB encoding for that reason.
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.
The
Blend
trait has been split intoCompose
,Blend
andBlendWith
, to allow more color spaces to be composed. The trait implementations were also changed from a default implementation to blanket implementations. Having blanket implementations allows users to only require the trait to be implemented without having to specify the trait's requirements. For example, it's only required to specifywhere C: Blend
instead of listing all the mathematical requirements.The
PreAlpha
type has also been changed a lot to get rid of the alpha type parameter and to leave premultiplication to the color types. A lot of it was developed in tandem with changing how the blending was implemented to make those implementations make more sense.Closed Issues
Breaking Change
The
Blend
trait, thePreAlpha
type and a lot of associated API has been changed. Most users should not notice too much, except for needing a different trait or getting it from theblend
module. TheComponentWise
trait is also gone, since all colors can be cast to arrays for iterationMSRV is changed to 1.55.0 to be able to use
[T; N]::map
.