-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add solarized palette as named colors #11927
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
Changes from 5 commits
63b8b65
befad3c
b1e9b57
22f03ee
1e5ec15
b329729
1dc142d
c5cd04b
4f766d3
e37e84c
72716ab
cec44bb
57c7d00
da7d5be
36d14cb
7d9f670
6138137
39eec2a
59761d7
d4f109e
fa9fda5
cf70a3d
88c05e7
6dbfb50
00f5c60
3dabeae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,8 @@ | |
from matplotlib import colors as mcolors | ||
|
||
|
||
colors = dict(mcolors.BASE_COLORS, **mcolors.CSS4_COLORS) | ||
colors = dict(mcolors.BASE_COLORS, **mcolors.CSS4_COLORS, | ||
**mcolors.SOLARIZED_COLORS) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please align the continued line with the inside I’d the parentheses, I.e. remove two spaces. |
||
8000 |
|
|
# Sort colors by hue, saturation, value and name. | ||
by_hsv = sorted((tuple(mcolors.rgb_to_hsv(mcolors.to_rgba(color)[:3])), name) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1142,3 +1142,26 @@ | |
'whitesmoke': '#F5F5F5', | ||
'yellow': '#FFFF00', | ||
'yellowgreen': '#9ACD32'} | ||
|
||
# These are the 16 colors of the Solarized palette by Ethan Schoonover. | ||
# See https://ethanschoonover.com/solarized/ | ||
# License: https://github.com/altercation/solarized/blob/master/LICENSE | ||
# Copyright (c) 2011 Ethan Schoonover | ||
SOLARIZED_COLORS = { | ||
'solarized-base03': '#002b36', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The namespacing method we use (cf. xkcd, tab) is "solarized:base03" (colon), not "solarized-base03" (dash). |
||
'solarized-base02': '#073642', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please align the color values with the color values of the CSS colors above. |
||
'solarized-base01': '#586e75', | ||
'solarized-base00': '#657b83', | ||
'solarized-base0': '#839496', | ||
'solarized-base1': '#93a1a1', | ||
'solarized-base2': '#eee8d5', | ||
'solarized-base3': '#fdf6e3', | ||
'solarized-yellow': '#b58900', | ||
'solarized-orange': '#cb4b16', | ||
'solarized-red': '#dc322f', | ||
'solarized-magenta': '#d33682', | ||
'solarized-violet': '#6c71c4', | ||
'solarized-blue': '#268bd2', | ||
'solarized-cyan': '#2aa198', | ||
'solarized-green': '#859900', | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,8 @@ | |
|
||
import numpy as np | ||
import matplotlib.cbook as cbook | ||
from ._color_data import BASE_COLORS, TABLEAU_COLORS, CSS4_COLORS, XKCD_COLORS | ||
from ._color_data import BASE_COLORS, TABLEAU_COLORS, CSS4_COLORS, \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For multi-line imports we prefer enclosing in brackets over line-continuation characters, i.e.
|
||
XKCD_COLORS, SOLARIZED_COLORS | ||
|
||
|
||
class _ColorMapping(dict): | ||
|
@@ -69,6 +70,7 @@ def __delitem__(self, key): | |
|
||
_colors_full_map = {} | ||
# Set by reverse priority order. | ||
_colors_full_map.update(SOLARIZED_COLORS) | ||
_colors_full_map.update(XKCD_COLORS) | ||
_colors_full_map.update({k.replace('grey', 'gray'): v | ||
for k, v in XKCD_COLORS.items() | ||
|
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.
Can you put this in it's own file per https://github.com/matplotlib/matplotlib/blob/master/doc/users/next_whats_new/README.rst ?