-
Notifications
You must be signed in to change notification settings - Fork 61
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
Make color constructors const and remove or replace all with_wp
#239
Conversation
I couldn't convert any function that moves out of any kind of value in any way, like |
Benchmark for d4a1777Click to view benchmark
|
bors r+ |
Build succeeded: |
@Ogeon would it be possible to have a released version with this PR? And others that weren't released yet |
I will do it sooner than later. I will start looking through it today to make sure I didn't forget anything important. My day job has just been quite draining recently so I haven't had much energy (and time) for it during the past few weeks. |
with_wp
Thank you for your reply. Do take care! |
I have started writing up a quick blog post to summarize the changes, so it should be done sometime this week if nothing comes in the way. 🙂
Thanks! I know it hasn't been fun for those who are waiting for the next release but this is how I keep it at a good level. No need to worry! I will try to separate breaking and non-breaking changes in the future so I can make smaller releases. 🤔 |
I went through the color constructors and made them
const fn
(or made aconst fn
version of them). The named colors are using them now!I did also change the naming so that
new
is always producing a fully generic type and names likenew_srgb
can be used for specialized constructors. It's easier to discover via searching or auto complete if the name contains "new". I removedwith_wp
while doing this, except inHsv
,Hsl
andHwb
where I figured it would be good to still have an sRGB specialization. They are more likely to be "entry points" than most other types.Closed Issues
new
functions asconst
#134Breaking Change
The renamed and removed constructors will cause some breakage. Type inference will also be affected and may require additional type hints.