Skip to content

Commit 2af319b

Browse files
authored
Add standard color names (#76)
Closes #56
1 parent 406138d commit 2af319b

File tree

157 files changed

+3235
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+3235
-74
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ repos:
1818
rev: v0.971
1919
hooks:
2020
- id: mypy
21+
additional_dependencies: [types-all]

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,3 +203,14 @@ appearance of badges, or the available colors please update the table using the
203203
```bash
204204
inv examples
205205
```
206+
207+
## Color enumeration
208+
209+
The `anybadge.colors.Color` enum provides an easy way to specify badge colors. The enum
210+
can be updated with new definitions from Mozilla by running `inv colors.update`. This will
211+
download and parse the Mozilla color keywords table, combine it with existing colors in the
212+
Enum (maintaining all old values and using numbered suffixes for new values), and generate new
213+
Enum code that can be copied into the `colors.py` module.
214+
215+
After updating the module the example badges must be re-generated, and the table added to the
216+
`README.md` document (see [here](#documentation)).

README.md

Lines changed: 126 additions & 1 deletion
Large diffs are not rendered by default.

anybadge/colors.py

Lines changed: 151 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,162 @@
44

55

66
class Color(Enum):
7-
WHITE = "#FFFFFF"
8-
SILVER = "#C0C0C0"
9-
GRAY = "#808080"
107
BLACK = "#000000"
11-
RED = "#E05D44"
12-
BRIGHT_RED = "#FF0000"
13-
MAROON = "#800000"
14-
OLIVE = "#808000"
8+
NAVY = "#000080"
9+
DARKBLUE = "#00008B"
10+
MEDIUMBLUE = "#0000CD"
11+
BLUE = "#0000FF"
12+
DARKGREEN = "#006400"
13+
GREEN_2 = "#008000"
14+
TEAL = "#008080"
15+
DARKCYAN = "#008B8B"
16+
DEEPSKYBLUE = "#00BFFF"
17+
DARKTURQUOISE = "#00CED1"
18+
MEDIUMSPRINGGREEN = "#00FA9A"
1519
LIME = "#00FF00"
16-
BRIGHT_YELLOW = "#FFFF00"
17-
YELLOW = "#DFB317"
18-
GREEN = "#4C1"
19-
YELLOW_GREEN = "#A4A61D"
20+
SPRINGGREEN = "#00FF7F"
2021
AQUA = "#00FFFF"
21-
TEAL = "#008080"
22-
BLUE = "#0000FF"
23-
NAVY = "#000080"
24-
FUCHSIA = "#FF00FF"
22+
CYAN = "#00FFFF"
23+
MIDNIGHTBLUE = "#191970"
24+
DODGERBLUE = "#1E90FF"
25+
LIGHTSEAGREEN = "#20B2AA"
26+
FORESTGREEN = "#228B22"
27+
SEAGREEN = "#2E8B57"
28+
DARKSLATEGRAY = "#2F4F4F"
29+
DARKSLATEGREY = "#2F4F4F"
30+
LIMEGREEN = "#32CD32"
31+
MEDIUMSEAGREEN = "#3CB371"
32+
TURQUOISE = "#40E0D0"
33+
ROYALBLUE = "#4169E1"
34+
STEELBLUE = "#4682B4"
35+
DARKSLATEBLUE = "#483D8B"
36+
MEDIUMTURQUOISE = "#48D1CC"
37+
INDIGO = "#4B0082"
38+
GREEN = "#4C1"
39+
DARKOLIVEGREEN = "#556B2F"
40+
CADETBLUE = "#5F9EA0"
41+
CORNFLOWERBLUE = "#6495ED"
42+
REBECCAPURPLE = "#663399"
43+
MEDIUMAQUAMARINE = "#66CDAA"
44+
DIMGRAY = "#696969"
45+
DIMGREY = "#696969"
46+
SLATEBLUE = "#6A5ACD"
47+
OLIVEDRAB = "#6B8E23"
48+
SLATEGRAY = "#708090"
49+
SLATEGREY = "#708090"
50+
LIGHTSLATEGRAY = "#778899"
51+
LIGHTSLATEGREY = "#778899"
52+
MEDIUMSLATEBLUE = "#7B68EE"
53+
LAWNGREEN = "#7CFC00"
54+
CHARTREUSE = "#7FFF00"
55+
AQUAMARINE = "#7FFFD4"
56+
MAROON = "#800000"
2557
PURPLE = "#800080"
26-
ORANGE = "#FE7D37"
58+
OLIVE = "#808000"
59+
GRAY = "#808080"
60+
GREY = "#808080"
61+
SKYBLUE = "#87CEEB"
62+
LIGHTSKYBLUE = "#87CEFA"
63+
BLUEVIOLET = "#8A2BE2"
64+
DARKRED = "#8B0000"
65+
DARKMAGENTA = "#8B008B"
66+
SADDLEBROWN = "#8B4513"
67+
DARKSEAGREEN = "#8FBC8F"
68+
LIGHTGREEN = "#90EE90"
69+
MEDIUMPURPLE = "#9370DB"
70+
DARKVIOLET = "#9400D3"
71+
PALEGREEN = "#98FB98"
72+
DARKORCHID = "#9932CC"
73+
YELLOWGREEN = "#9ACD32"
2774
LIGHT_GREY = "#9F9F9F"
75+
SIENNA = "#A0522D"
76+
YELLOW_GREEN = "#A4A61D"
77+
BROWN = "#A52A2A"
78+
DARKGRAY = "#A9A9A9"
79+
DARKGREY = "#A9A9A9"
80+
LIGHTBLUE = "#ADD8E6"
81+
GREENYELLOW = "#ADFF2F"
82+
PALETURQUOISE = "#AFEEEE"
83+
LIGHTSTEELBLUE = "#B0C4DE"
84+
POWDERBLUE = "#B0E0E6"
85+
FIREBRICK = "#B22222"
86+
DARKGOLDENROD = "#B8860B"
87+
MEDIUMORCHID = "#BA55D3"
88+
ROSYBROWN = "#BC8F8F"
89+
DARKKHAKI = "#BDB76B"
90+
SILVER = "#C0C0C0"
91+
MEDIUMVIOLETRED = "#C71585"
92+
INDIANRED = "#CD5C5C"
93+
PERU = "#CD853F"
94+
CHOCOLATE = "#D2691E"
95+
TAN = "#D2B48C"
96+
LIGHTGRAY = "#D3D3D3"
97+
LIGHTGREY = "#D3D3D3"
98+
THISTLE = "#D8BFD8"
99+
ORCHID = "#DA70D6"
100+
GOLDENROD = "#DAA520"
101+
PALEVIOLETRED = "#DB7093"
102+
CRIMSON = "#DC143C"
103+
GAINSBORO = "#DCDCDC"
104+
PLUM = "#DDA0DD"
105+
BURLYWOOD = "#DEB887"
106+
YELLOW = "#DFB317"
107+
RED = "#E05D44"
108+
LIGHTCYAN = "#E0FFFF"
109+
LAVENDER = "#E6E6FA"
110+
DARKSALMON = "#E9967A"
111+
VIOLET = "#EE82EE"
112+
PALEGOLDENROD = "#EEE8AA"
113+
LIGHTCORAL = "#F08080"
114+
KHAKI = "#F0E68C"
115+
ALICEBLUE = "#F0F8FF"
116+
HONEYDEW = "#F0FFF0"
117+
AZURE = "#F0FFFF"
118+
SANDYBROWN = "#F4A460"
119+
WHEAT = "#F5DEB3"
120+
BEIGE = "#F5F5DC"
121+
WHITESMOKE = "#F5F5F5"
122+
MINTCREAM = "#F5FFFA"
123+
GHOSTWHITE = "#F8F8FF"
124+
SALMON = "#FA8072"
125+
ANTIQUEWHITE = "#FAEBD7"
126+
LINEN = "#FAF0E6"
127+
LIGHTGOLDENRODYELLOW = "#FAFAD2"
128+
OLDLACE = "#FDF5E6"
129+
ORANGE = "#FE7D37"
130+
BRIGHT_RED = "#FF0000"
131+
RED_2 = "#FF0000"
132+
FUCHSIA = "#FF00FF"
133+
MAGENTA = "#FF00FF"
134+
DEEPPINK = "#FF1493"
135+
ORANGERED = "#FF4500"
136+
TOMATO = "#FF6347"
137+
HOTPINK = "#FF69B4"
138+
CORAL = "#FF7F50"
139+
DARKORANGE = "#FF8C00"
140+
LIGHTSALMON = "#FFA07A"
141+
ORANGE_2 = "#FFA500"
142+
LIGHTPINK = "#FFB6C1"
143+
PINK = "#FFC0CB"
144+
GOLD = "#FFD700"
145+
PEACHPUFF = "#FFDAB9"
146+
NAVAJOWHITE = "#FFDEAD"
147+
MOCCASIN = "#FFE4B5"
148+
BISQUE = "#FFE4C4"
149+
MISTYROSE = "#FFE4E1"
150+
BLANCHEDALMOND = "#FFEBCD"
151+
PAPAYAWHIP = "#FFEFD5"
152+
LAVENDERBLUSH = "#FFF0F5"
153+
SEASHELL = "#FFF5EE"
154+
CORNSILK = "#FFF8DC"
155+
LEMONCHIFFON = "#FFFACD"
156+
FLORALWHITE = "#FFFAF0"
157+
SNOW = "#FFFAFA"
158+
BRIGHT_YELLOW = "#FFFF00"
159+
YELLOW_2 = "#FFFF00"
160+
LIGHTYELLOW = "#FFFFE0"
161+
IVORY = "#FFFFF0"
162+
WHITE = "#FFFFFF"
28163

29164
def __lt__(self, other):
30165
return self.name < other.name

build-requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
beautifulsoup4
12
invoke
23
pygments
34
pytest
45
pytest-cov
56
requests
7+
types-all

examples/color_aliceblue.svg

Lines changed: 23 additions & 0 deletions
Loading

examples/color_antiquewhite.svg

Lines changed: 23 additions & 0 deletions
Loading

examples/color_aqua.svg

Lines changed: 2 additions & 2 deletions
Loading

examples/color_aquamarine.svg

Lines changed: 23 additions & 0 deletions
Loading

examples/color_azure.svg

Lines changed: 23 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)