File tree Expand file tree Collapse file tree 4 files changed +24
-1
lines changed Expand file tree Collapse file tree 4 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,9 @@ def _hex_converter(arg):
8484 if mcolors is not None :
8585 return JInt (int ("0xFF" + mcolors .to_hex (arg )[1 :], base = 16 ))
8686 except :
87- return None
87+ raise RuntimeError (
88+ f"unknown color or unparsable color string '{ arg } '"
89+ ) from None
8890 elif isinstance (arg , (int , np .integer )) and 0x7FFFFFFF < arg <= 0xFFFFFFFF :
8991 return JInt (arg )
9092 elif colour is not None and isinstance (arg , colour .Color ):
Original file line number Diff line number Diff line change 2222mcolor_css4 = None # DELETE
2323
2424{mcolor_css4 }
25+
26+
27+ def __getattr__ (name ):
28+ if name in locals ():
29+ return locals ()[name ]
30+ else :
31+ raise AttributeError ("unknown css4 color '" + name + "'" )
Original file line number Diff line number Diff line change 2222mpl_cmaps = None # DELETE
2323
2424{mpl_cmaps }
25+
26+
27+ def __getattr__ (name ):
28+ if name in locals ():
29+ return locals ()[name ]
30+ else :
31+ raise AttributeError ("unknown matplotlib colormap '" + name + "'" )
Original file line number Diff line number Diff line change 2222mcolor_xkcd = None # DELETE
2323
2424{mcolor_xkcd }
25+
26+
27+ def __getattr__ (name ):
28+ if name in locals ():
29+ return locals ()[name ]
30+ else :
31+ raise AttributeError ("unknown xkcd color '" + name + "'" )
You can’t perform that action at this time.
0 commit comments