{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6701","repository_url":"https://api.github.com/repos/matplotlib/matplotlib","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6701/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6701/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6701/events","html_url":"https://github.com/matplotlib/matplotlib/pull/6701","id":164294149,"number":6701,"title":"Colours like 'XeYYYY' don't get recognised properly if X, Y's are numbers","user":{"login":"myyc","id":5025392,"avatar_url":"https://avatars.githubusercontent.com/u/5025392?v=3","gravatar_id":"","url":"https://api.github.com/users/myyc","html_url":"https://github.com/myyc","followers_url":"https://api.github.com/users/myyc/followers","following_url":"https://api.github.com/users/myyc/following{/other_user}","gists_url":"https://api.github.com/users/myyc/gists{/gist_id}","starred_url":"https://api.github.com/users/myyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myyc/subscriptions","organizations_url":"https://api.github.com/users/myyc/orgs","repos_url":"https://api.github.com/users/myyc/repos","events_url":"https://api.github.com/users/myyc/events{/privacy}","received_events_url":"https://api.github.com/users/myyc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/matplotlib/matplotlib/labels/needs_review","name":"needs_review","color":"009800"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/14","html_url":"https://github.com/matplotlib/matplotlib/milestones/2.0%20(style%20change%20major%20release)","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/14/labels","id":662004,"number":14,"title":"2.0 (style change major release)","description":"Style changes only","creator":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"open_issues":49,"closed_issues":389,"state":"open","created_at":"2014-05-17T14:28:22Z","updated_at":"2016-07-07T12:59:58Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-07-07T12:08:55Z","updated_at":"2016-07-07T13:23:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6701","html_url":"https://github.com/matplotlib/matplotlib/pull/6701","diff_url":"https://github.com/matplotlib/matplotlib/pull/6701.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/6701.patch"},"body":"`'8e1245'` gets recognised as `8*10^(1245)`. While this is intended behaviour, all around `matplotlib` there seems to be some ambiguity as to whether hex colours should have a trailing hash (e.g.: `hex2color` fails **without** hash while colours in a `cycler` in a stylesheet fail **with** a hash).\r\n\r\nThis patch doesn't fix cases such as `0e1123` because they get interpreted as `0.0` so it probably needs a more fundamental decision.\r\n\r\nThoughts?"},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/231075879","html_url":"https://github.com/matplotlib/matplotlib/pull/6701#issuecomment-231075879","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6701","id":231075879,"user":{"login":"myyc","id":5025392,"avatar_url":"https://avatars.githubusercontent.com/u/5025392?v=3","gravatar_id":"","url":"https://api.github.com/users/myyc","html_url":"https://github.com/myyc","followers_url":"https://api.github.com/users/myyc/followers","following_url":"https://api.github.com/users/myyc/following{/other_user}","gists_url":"https://api.github.com/users/myyc/gists{/gist_id}","starred_url":"https://api.github.com/users/myyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myyc/subscriptions","organizations_url":"https://api.github.com/users/myyc/orgs","repos_url":"https://api.github.com/users/myyc/repos","events_url":"https://api.github.com/users/myyc/events{/privacy}","received_events_url":"https://api.github.com/users/myyc/received_events","type":"User","site_admin":false},"created_at":"2016-07-07T13:23:20Z","updated_at":"2016-07-07T13:23:20Z","body":"`rcsetup.validate_color` calls `colors._to_rgba_no_colorcycle` if all else fails, so [this call](https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/rcsetup.py#L370) will return `True` before adding the `#`.\r\n\r\nRemember that `0 <= c <=1` is not enough as `float('0e0123') == 0`.\r\n\r\nI am fully aware that my patch doesn't fix the bug itself. One possible way could be to prioritise `is_color_like('#' + s)` over `is_color_like(s)` if `s` is a 6-8char string. This fixes the `rc` validation, but the overall issue stays."}}
{"actor":{"display_login":"myyc"}}