File tree 1 file changed +4
-13
lines changed
1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -251,21 +251,11 @@ def to_hex(c, keep_alpha=False):
251
251
252
252
### Backwards-compatible color-conversion API
253
253
254
+
254
255
cnames = CSS4_COLORS
255
256
hexColorPattern = re .compile (r"\A#[a-fA-F0-9]{6}\Z" )
256
-
257
-
258
- def rgb2hex (c ):
259
- 'Given an rgb or rgba sequence of 0-1 floats, return the hex string'
260
- return to_hex (c )
261
-
262
-
263
- def hex2color (c ):
264
- """
265
- Take a hex string *s* and return the corresponding rgb 3-tuple
266
- Example: #efefef -> (0.93725, 0.93725, 0.93725)
267
- """
268
- return ColorConverter .to_rgb (c )
257
+ rgb2hex = to_hex
258
+ hex2color = to_rgb
269
259
270
260
271
261
class ColorConverter (object ):
@@ -328,6 +318,7 @@ def to_rgba_array(arg, alpha=None):
328
318
329
319
colorConverter = ColorConverter ()
330
320
321
+
331
322
### End of backwards-compatible color-conversion API
332
323
333
324
You can’t perform that action at this time.
0 commit comments