Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Use xkcd: prefix to avoid color name clashes. #6390
Conversation
mdboom
added the
needs_review
label
May 9, 2016
tacaswell
added this to the
2.0 (style change major release)
milestone
May 9, 2016
tacaswell
and 1 other
commented on an outdated diff
May 9, 2016
| All string specifications of color are case-insensitive. | ||
| Internally, mpl is moving to storing all colors as RGBA float quadruples. | ||
| - | ||
| -Name clash between CSS4/X11 and XKCD |
tacaswell
Owner
|
|
I am still in favor of leaving both the prefixed and un-prefixed versions. For names that are only in the xkcd name space there is no reason to include the extra 5 characters. We should also document the names as |
|
I can change the prefix to XKCD, no problem there. |
|
One of the things we decided in the discussion on the pr where the XKCD On Mon, May 9, 2016, 16:10 Antony Lee notifications@github.com wrote:
|
|
Then the "base" namespace could cover both the one-letter codes and the CSS4 names? |
|
I am hesitant to combine the single letter colors (which are home grown) The other concern is that we can not encode the single letter colors as hex On Mon, May 9, 2016 at 4:37 PM Antony Lee notifications@github.com wrote:
|
|
TBH I don't feel strongly about anything here, except that having a name clash by default looks... unappetizing. A namespacing/priority mechanism (say, "base", "css4", "xkcd", "seaborn-<...>") would not, by default, change the meaning of the CSS colors (but it would be possible for the user the change them -- in a more "ordered" manner than seaborn currently changes the base colors. |
|
By the way, regarding xkcd vs XKCD: http://xkcd.com/about/
|
|
huh, fair enough re xkcd. Could have sworn I read the opposite.... |
tacaswell
commented on the diff
May 11, 2016
tacaswell
commented on the diff
May 11, 2016
| @@ -961,14 +961,9 @@ | ||
| 'green': '#15b01a', | ||
| 'purple': '#7e1e9c'} | ||
| -# normalize to names with no spaces and provide versions with XKCD | ||
| -# prefix. | ||
| -for k in list(XKCD_COLORS): | ||
| - XKCD_COLORS['xkcd'+k] = XKCD_COLORS[k] | ||
| - _k = k.replace(' ', '') | ||
| - if _k != k: | ||
| - XKCD_COLORS[_k] = XKCD_COLORS[k] | ||
| - XKCD_COLORS['xkcd'+_k] = XKCD_COLORS[k] | ||
| + | ||
| +# Normalize name to "xkcd:<name>" to avoid name collisions. | ||
| +XKCD_COLORS = {'xkcd:' + name: value for name, value in XKCD_COLORS.items()} |
anntzer
Contributor
|
|
I am also |
|
I have no idea what's wrong with this build... |
tacaswell
commented on the diff
May 12, 2016
tacaswell
commented on the diff
May 12, 2016
|
I like the use of 'xkcd:' as a prefix for all xkcd colors. |
|
I completely missed that there is both 'dark blue' and 'darkblue'. The downsides of machine learning + crowd sourcing.... |
|
Here's the offenders:
Anyways, I guess this answers the question... |
tacaswell
merged commit d03e798
into matplotlib:master
May 12, 2016
tacaswell
removed the
needs_review
label
May 12, 2016
|
I will fix that figure my self in a follow on PR |
anntzer
deleted the
anntzer:xkcd-colors-namespace branch
May 12, 2016
tacaswell
added a commit
that referenced
this pull request
May 12, 2016
|
|
tacaswell |
c2b6769
|
|
backported to 2.x as c2b6769 |
anntzer commentedMay 9, 2016
Split out of #6382.
Without the prefix, merging CSS4_COLORS and XKCD_COLORS becomes order-dependent.
It's also unclear why space-less names are needed, but I can put them back if someone feels strongly about it...