-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Support for shorthand hex colors. #15152
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
Support for shorthand hex colors. #15152
Conversation
Looks good to me - could you add a quick note in |
For reference this is defined at https://www.w3.org/TR/css-color-4/#hex-notation. Likely https://matplotlib.org/tutorials/colors/colors.html and a few other places will also need updating. |
I added a line about the change in the colors.py and in the color specification tutorial, as well as a new entry in |
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.
👍 thanks for the PR!
A link to the css spec (e.g. the one I posted above) in colors.py would be nice. (Probably not necessary in the tutorial as well.) |
👍 Thanks @PatrickFeiring ! |
re-milestoned to 3.2 as we have not branched yet so it's going to be in 3.2 not 3.3. |
PR Summary
Added support for shorthand hex colors as described in section 4.2 of the current CSS Color Module Level 4 Working Draft from 5 March 2019.
Examples:
#123 is interpreted as #112233
#123a is interpreted as #112233aa
It is a minor change, and I did this mainly to match expectations for anyone coming from web design (myself including) and to make tasks like specifying softer blacks like #333 or greys like #ccc quicker.
PR Checklist