Skip to content

Commit

Permalink
fix: fixing some issues with color handling in meshes
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Jun 14, 2024
1 parent 8eba118 commit c148563
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion API/oursin/meshes.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def set_colors(meshes_list, colors_list):

data = IDListColorList(
ids = [x.data.id for x in meshes_list],
values = [utils.formatted_color(utils.sanitize_vector3(x)) for x in colors_list]
values = [utils.formatted_color(x) for x in colors_list]
)

client.sio.emit('urchin-meshes-colors', data.to_string())
Expand Down
3 changes: 1 addition & 2 deletions API/oursin/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ def sanitize_color(color):
raise ValueError("Input list must contain three or four floats.")

elif isinstance(color, str):
if color.startswith('#'):
return hex_to_rgb(color)
return hex_to_rgb(color)

else:
raise TypeError("Input type not recognized.")
Expand Down

0 comments on commit c148563

Please sign in to comment.