Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Micro-optimize _to_rgba_no_colorcycle.#30020
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
f3f2c44
to9dc9749
Comparelib/matplotlib/colors.py Outdated
return (*[n / 0xff for n in bytes.fromhex(c[1:])], | ||
alpha if alpha is not None else 1.) | ||
elif len(c) == 4: # #rgb hex format, shorthand for #rrggbb. | ||
return (*[int(n, 16) * 0x11 / 0xff for n in c[1:]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is just ?
return (*[int(n,16)*0x11/0xffforninc[1:]], | |
return (*[int(n,16)/0xfforninc[1:]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
ah indeed, even better.
This patch speeds up conversions of `#rgba`-type formats by between 25%and 40% (while shortening the implementation), although real benefitsshould be limited because of caching in to_rgba.
@story645 Did you mean to close this? |
No sorry, my phone's been a little broken and I was probably looking at this on the app and accidentally closed it w/o noticing |
6dcfa9d
intomatplotlib:mainUh oh!
There was an error while loading.Please reload this page.
This patch speeds up conversions of
#rgba
-type formats by between 25% and 40% (while shortening the implementation), although real benefits should be limited because of caching in to_rgba.PR summary
PR checklist