Title: Fixed _has_alpha_channel function to work with hex and tuple colors by raunak-sood2003 · Pull Request #27463 · matplotlib/matplotlib · GitHub
Open Graph Title: Fixed _has_alpha_channel function to work with hex and tuple colors by raunak-sood2003 · Pull Request #27463 · matplotlib/matplotlib
X Title: Fixed _has_alpha_channel function to work with hex and tuple colors by raunak-sood2003 · Pull Request #27463 · matplotlib/matplotlib
Description: PR summary This PR fixes bug #27321. The _has_alpha_channel function didn't work for hex strings and tuples because it just checked for decimal strings of length 4 (RGBA). The new implementation cases on the three different possible inputs (decimal, hex, and tuple) and determines if the input is a valid color that has an alpha channel. For checking hex colors, the function checks if all the symbols are hex values (0-9, A-F), and if the string is the correct length. Since hex values can be represented with the prefix "#" or "0x", the input strings have to be of length 9 or 10 (prefix + 4 bytes or 8 hex values for all channels). PR checklist "closes #0000" is in the body of the PR description to link the related issue new and changed code is tested Plotting related features are demonstrated in an example New Features and API Changes are noted with a directive and release note Documentation complies with general and docstring guidelines Note This PR doesn't pass the MyPy Stubtest, but passes all of the others. I'm not entirely sure how to get it to pass that, although it doesn't seem like too big of an error.
Open Graph Description: PR summary This PR fixes bug #27321. The _has_alpha_channel function didn't work for hex strings and tuples because it just checked for decimal strings of length 4 (RGBA). The new implementatio...
X Description: PR summary This PR fixes bug #27321. The _has_alpha_channel function didn't work for hex strings and tuples because it just checked for decimal strings of length 4 (RGBA). The new implement...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/27463
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:43cfcbb3-b127-60b1-070c-949ad0521fae |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B1A8:223B9A:DAF24B:1297B53:6A51F875 |
| html-safe-nonce | 18299deafbbbd3b9094ce158a874f70c327a7fcca08eb08277b06ab2909c31d0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMUE4OjIyM0I5QTpEQUYyNEI6MTI5N0I1Mzo2QTUxRjg3NSIsInZpc2l0b3JfaWQiOiI4OTE5NTgxNTM3MTM5MjkyMjc3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 221b2d78f8ca185ee63b875ddf021eb1c02051f439f466906c8b5488e677fbcc |
| hovercard-subject-tag | pull_request:1635040370 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/27463/files |
| twitter:image | https://avatars.githubusercontent.com/u/43318621?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/43318621?s=400&v=4 |
| og:image:alt | PR summary This PR fixes bug #27321. The _has_alpha_channel function didn't work for hex strings and tuples because it just checked for decimal strings of length 4 (RGBA). The new implementatio... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width