Title: matplotlib.colors rgb2hex is not the right inverse of hex2color · Issue #18574 · matplotlib/matplotlib · GitHub
Open Graph Title: matplotlib.colors rgb2hex is not the right inverse of hex2color · Issue #18574 · matplotlib/matplotlib
X Title: matplotlib.colors rgb2hex is not the right inverse of hex2color · Issue #18574 · matplotlib/matplotlib
Description: >>> matplotlib.__version__ '3.3.2' >>> from matplotlib.colors import rgb2hex, hex2color >>> rgb_color = (0.5, 0.5, 0.9) >>> hex2color(rgb2hex(rgb_color)) (0.5019607843137255, 0.5019607843137255, 0.9019607843137255) It should return (0.5,...
Open Graph Description: >>> matplotlib.__version__ '3.3.2' >>> from matplotlib.colors import rgb2hex, hex2color >>> rgb_color = (0.5, 0.5, 0.9) >>> hex2color(rgb2hex(rgb_color)) (0.5019607843137255, 0.5019607843137255, 0....
X Description: >>> matplotlib.__version__ '3.3.2' >>> from matplotlib.colors import rgb2hex, hex2color >>> rgb_color = (0.5, 0.5, 0.9) >>> hex2color(rgb2hex(rgb_color))...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/18574
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"matplotlib.colors rgb2hex is not the right inverse of hex2color","articleBody":"```\r\n\u003e\u003e\u003e matplotlib.__version__\r\n'3.3.2'\r\n\u003e\u003e\u003e from matplotlib.colors import rgb2hex, hex2color\r\n\u003e\u003e\u003e rgb_color = (0.5, 0.5, 0.9)\r\n\u003e\u003e\u003e hex2color(rgb2hex(rgb_color))\r\n(0.5019607843137255, 0.5019607843137255, 0.9019607843137255)\r\n```\r\nIt should return `(0.5, 0.5, 0.9)`.\r\nAs it seems the additive factor it is always the same, it should be a matter of subtracting 0.0019607843137255 from the three channels.\r\n\r\nThanks!\r\n\r\n---------\r\nP.S. the inverse composition works as expected:\r\n```\r\n\u003e\u003e\u003e rgb2hex(hex2color( '#808080'))\r\n'#808080'\r\n```","author":{"url":"https://github.com/SebastianoF","@type":"Person","name":"SebastianoF"},"datePublished":"2020-09-25T13:49:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/18574/matplotlib/issues/18574"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:119901f5-f637-5186-810f-70e29345c0c3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C4C:3A486F:2EF3F4:3EFD51:6A52EBB1 |
| html-safe-nonce | a66bd2dcd83da031e2eaf766f626d8f1911c2b28dbfe5aee20b57264afd1068c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzRDOjNBNDg2RjoyRUYzRjQ6M0VGRDUxOjZBNTJFQkIxIiwidmlzaXRvcl9pZCI6IjEwMzY4NDMxNzY1MDI4MzQ0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fcfc332fc93b6936140957efbbe3c5702cc0e80801aea850a44a500129866b3c |
| hovercard-subject-tag | issue:708954544 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/matplotlib/matplotlib/18574/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3ae480da9155835fc616302515db3728b383c2c23931ab05a85225828244c5e9/matplotlib/matplotlib/issues/18574 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3ae480da9155835fc616302515db3728b383c2c23931ab05a85225828244c5e9/matplotlib/matplotlib/issues/18574 |
| og:image:alt | >>> matplotlib.__version__ '3.3.2' >>> from matplotlib.colors import rgb2hex, hex2color >>> rgb_color = (0.5, 0.5, 0.9) >>> hex2color(rgb2hex(rgb_color)) (0.5019607843137255, 0.5019607843137255, 0.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SebastianoF |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| 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 | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width