Repository navigation
Replies: 1 comment
|
Hi, they are implemented for float via a blanket implementation for anything real-ish: impl<T> Stimulus for T
where
T: Real + One + Zero,
{
#[inline]
fn max_intensity() -> Self {
Self::one()
}
}You can see it at the bottom of this page: https://docs.rs/palette/0.7.3/palette/stimulus/trait.Stimulus.html. Your example should work fine if you need to convert the values from one type to another. Another change since 0.5 is that It may also be worth looking through the release announcements, if you haven't. They highlight most of the major changes:
I hope this was the answer you were looking for. Don't hesitate to ask about anything else that you encounter! |
Uh oh!
There was an error while loading. Please reload this page.
I recently started working on a codebase that used 0.5 and I'm going through and updating the dependencies, but I'm having trouble understanding the upgrade path from 0.5 -> 0.7.
The
Componenttrait was implemented for float and integer types, but now theStimulustrait appears to only be implemented for integer types. If I previously had an interface like this:Would the new interface look like this?
Does this mean that color types can no longer hold floats?
All reactions