Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion py5_resources/py5_module/py5/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def _hex_converter(arg):
if mcolors is not None:
return JInt(int("0xFF" + mcolors.to_hex(arg)[1:], base=16))
except:
return None
raise RuntimeError(
f"unknown color or unparsable color string '{arg}'"
) from None
elif isinstance(arg, (int, np.integer)) and 0x7FFFFFFF < arg <= 0xFFFFFFFF:
return JInt(arg)
elif colour is not None and isinstance(arg, colour.Color):
Expand Down
7 changes: 7 additions & 0 deletions py5_resources/py5_module/py5_tools/colors/css4.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@
mcolor_css4 = None # DELETE

{mcolor_css4}


def __getattr__(name):
if name in locals():
return locals()[name]
else:
raise AttributeError("unknown css4 color '" + name + "'")
7 changes: 7 additions & 0 deletions py5_resources/py5_module/py5_tools/colors/mpl_cmaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@
mpl_cmaps = None # DELETE

{mpl_cmaps}


def __getattr__(name):
if name in locals():
return locals()[name]
else:
raise AttributeError("unknown matplotlib colormap '" + name + "'")
7 changes: 7 additions & 0 deletions py5_resources/py5_module/py5_tools/colors/xkcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@
mcolor_xkcd = None # DELETE

{mcolor_xkcd}


def __getattr__(name):
if name in locals():
return locals()[name]
else:
raise AttributeError("unknown xkcd color '" + name + "'")