Skip to content

Commit

Permalink
docstring for the win
Browse files Browse the repository at this point in the history
  • Loading branch information
hadim committed Jun 22, 2023
1 parent 1e1b90a commit e01067a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions datamol/viz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,10 @@ def image_to_file(
def to_rdkit_color(color: Optional[DatamolColor]) -> Optional[RDKitColor]:
"""If required convert a datamol color (rgb, rgba or hex string) to an RDKit
color (rgb or rgba).
Args:
color: A datamol color: hex, rgb, rgba or None.
"""
if isinstance(color, str):
return mcolors.to_rgba(color) # type: ignore
else:
return color
return color

0 comments on commit e01067a

Please sign in to comment.